Commit 52eb84ad authored by Matthias Putz's avatar Matthias Putz

added steadily changing workspace.xml to .gitignore + fixes for coloring under…

added steadily changing workspace.xml to .gitignore + fixes for coloring under windows + debugging in linux => std cmds work
parent 4ff9501b
bin
.idea/workspace.xml
*.bak
*.pyc
.repopickle_*
This diff is collapsed.
......@@ -45,9 +45,7 @@ from pager import _SelectPager
from subcmds import all_commands
global_options = optparse.OptionParser(
usage="repo [-p|--paginate|--no-pager] COMMAND [ARGS]"
)
global_options = optparse.OptionParser(usage="repo [-p|--paginate|--no-pager|--piped-into-less] COMMAND [ARGS]")
global_options.add_option('-p', '--paginate',
dest='pager', action='store_true',
help='display command output in the pager')
......@@ -63,6 +61,7 @@ global_options.add_option('--time',
global_options.add_option('--version',
dest='show_version', action='store_true',
help='display this version of repo')
global_options.add_option("--piped-into-less", action="store_true", dest="pipedIntoLess", default=False)
def _UsePager(name, cmd, gopts, copts):
......@@ -411,12 +410,16 @@ def _WindowsPager(repo):
args2 = args[argsSplit+1:]
pager = _SelectPager(cmd.manifest.globalConfig)
shellCommand = "%s %s %s -- --no-pager %s | %s" % (python, thisScript, ' '.join(args1), ' '.join(args2), pager)
print("EXECUTE: %s" % shellCommand)
shellCommand = "%s %s %s -- --piped-into-less --no-pager %s | %s" % (python, thisScript, ' '.join(args1), ' '.join(args2), pager)
os.system(shellCommand)
return True
return False
else:
# set global variable if output is piped into less; means that pager is simulated, this
# leads to correct coloring in windows
import pager
pager.active = gopts.pipedIntoLess
return False
def _Main(argv):
result = 0
......@@ -451,8 +454,11 @@ def _Main(argv):
exit(0);
if opt.debug:
print("enter debug mode, host %s" % opt.debug_host)
_Debug(opt.debug_host, opt.debug_env)
print("enter debug mode, host %s" % opt.debug_host)
_Debug(opt.debug_host, opt.debug_env)
if portable.isPosix():
# deactivate pager on posix systems since forked process cant be debugged
os.environ['GIT_PAGER'] = ''
try:
try:
......
......@@ -1953,6 +1953,9 @@ class Project(object):
rr_cache = os.path.join(self.gitdir, 'rr-cache')
if not os.path.exists(rr_cache):
os.makedirs(rr_cache)
packed_refs = os.path.join(self.gitdir, 'packed-refs')
if not os.path.exists(packed_refs):
fd = open(packed_refs, "w")
for name in ['config',
'description',
......
......@@ -734,7 +734,7 @@ class _FetchTimes(object):
def _Load(self):
if self._times is None:
try:
f = open(self._path)
f = open(self._path, mode='rb')
except IOError:
self._times = {}
return self._times
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment