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 bin
.idea/workspace.xml
*.bak *.bak
*.pyc *.pyc
.repopickle_* .repopickle_*
This diff is collapsed.
...@@ -45,9 +45,7 @@ from pager import _SelectPager ...@@ -45,9 +45,7 @@ from pager import _SelectPager
from subcmds import all_commands from subcmds import all_commands
global_options = optparse.OptionParser( global_options = optparse.OptionParser(usage="repo [-p|--paginate|--no-pager|--piped-into-less] COMMAND [ARGS]")
usage="repo [-p|--paginate|--no-pager] COMMAND [ARGS]"
)
global_options.add_option('-p', '--paginate', global_options.add_option('-p', '--paginate',
dest='pager', action='store_true', dest='pager', action='store_true',
help='display command output in the pager') help='display command output in the pager')
...@@ -63,6 +61,7 @@ global_options.add_option('--time', ...@@ -63,6 +61,7 @@ global_options.add_option('--time',
global_options.add_option('--version', global_options.add_option('--version',
dest='show_version', action='store_true', dest='show_version', action='store_true',
help='display this version of repo') 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): def _UsePager(name, cmd, gopts, copts):
...@@ -411,11 +410,15 @@ def _WindowsPager(repo): ...@@ -411,11 +410,15 @@ def _WindowsPager(repo):
args2 = args[argsSplit+1:] args2 = args[argsSplit+1:]
pager = _SelectPager(cmd.manifest.globalConfig) pager = _SelectPager(cmd.manifest.globalConfig)
shellCommand = "%s %s %s -- --no-pager %s | %s" % (python, thisScript, ' '.join(args1), ' '.join(args2), pager) shellCommand = "%s %s %s -- --piped-into-less --no-pager %s | %s" % (python, thisScript, ' '.join(args1), ' '.join(args2), pager)
print("EXECUTE: %s" % shellCommand)
os.system(shellCommand) os.system(shellCommand)
return True return True
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 return False
def _Main(argv): def _Main(argv):
...@@ -453,6 +456,9 @@ def _Main(argv): ...@@ -453,6 +456,9 @@ def _Main(argv):
if opt.debug: if opt.debug:
print("enter debug mode, host %s" % opt.debug_host) print("enter debug mode, host %s" % opt.debug_host)
_Debug(opt.debug_host, opt.debug_env) _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:
try: try:
......
...@@ -1953,6 +1953,9 @@ class Project(object): ...@@ -1953,6 +1953,9 @@ class Project(object):
rr_cache = os.path.join(self.gitdir, 'rr-cache') rr_cache = os.path.join(self.gitdir, 'rr-cache')
if not os.path.exists(rr_cache): if not os.path.exists(rr_cache):
os.makedirs(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', for name in ['config',
'description', 'description',
......
...@@ -734,7 +734,7 @@ class _FetchTimes(object): ...@@ -734,7 +734,7 @@ class _FetchTimes(object):
def _Load(self): def _Load(self):
if self._times is None: if self._times is None:
try: try:
f = open(self._path) f = open(self._path, mode='rb')
except IOError: except IOError:
self._times = {} self._times = {}
return 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