Commit 7486c3ba authored by Matthias Putz's avatar Matthias Putz

fixes: debug option, formatting, ..

parent e5328a48
...@@ -49,7 +49,7 @@ from subcmds import all_commands ...@@ -49,7 +49,7 @@ from subcmds import all_commands
from repo_trace import REPO_TRACE, IsTrace, Trace from repo_trace import REPO_TRACE, IsTrace, Trace
global_options = optparse.OptionParser(usage="repo [-p|--paginate|--no-pager|--piped-into-less] COMMAND [ARGS]") global_options = optparse.OptionParser(usage="repo [-p|--paginate|--no-pager|--piped-into-less|--debug|--debug-host|--debug-env] 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')
...@@ -66,6 +66,9 @@ global_options.add_option('--version', ...@@ -66,6 +66,9 @@ 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-pager", action="store_true", dest="pipedIntoPager", default=False) global_options.add_option("--piped-into-pager", action="store_true", dest="pipedIntoPager", default=False)
global_options.add_option("--debug", action="store_true", dest="debug", default=False)
global_options.add_option("--debug-host", dest="debug_host", default='localhost')
global_options.add_option("--debug-env", dest="debug_env", default="intellij")
def _UsePager(name, cmd, gopts, copts): def _UsePager(name, cmd, gopts, copts):
...@@ -438,9 +441,6 @@ def _Main(argv): ...@@ -438,9 +441,6 @@ def _Main(argv):
help="version of the wrapper script") help="version of the wrapper script")
opt.add_option("--wrapper-path", dest="wrapper_path", opt.add_option("--wrapper-path", dest="wrapper_path",
help="location of the wrapper script") help="location of the wrapper script")
opt.add_option("-d", "--debug", action="store_true", dest="debug", default=False)
opt.add_option("--debug-host", dest="debug_host", default='localhost')
opt.add_option("--debug-env", dest="debug_env", default="intellij")
_PruneOptions(argv, opt) _PruneOptions(argv, opt)
opt, argv = opt.parse_args(argv) opt, argv = opt.parse_args(argv)
...@@ -460,9 +460,10 @@ def _Main(argv): ...@@ -460,9 +460,10 @@ def _Main(argv):
# everything was already done; so exit # everything was already done; so exit
return 0 return 0
if opt.debug: gopts = repo.config[2]
print("enter debug mode, host %s" % opt.debug_host) if gopts.debug:
_Debug(opt.debug_host, opt.debug_env) print("enter debug mode, host %s" % gopts.debug_host)
_Debug(gopts.debug_host, gopts.debug_env)
if portable.isPosix(): if portable.isPosix():
# deactivate pager on posix systems since forked process cant be debugged # deactivate pager on posix systems since forked process cant be debugged
os.environ['GIT_PAGER'] = '' os.environ['GIT_PAGER'] = ''
......
...@@ -1139,7 +1139,7 @@ class Project(object): ...@@ -1139,7 +1139,7 @@ class Project(object):
last_mine = None last_mine = None
cnt_mine = 0 cnt_mine = 0
for commit in local_changes: for commit in local_changes:
commit_id, committer_email = commit.split(' ', 1) commit_id, committer_email = portable.stream2str(commit).split(' ', 1)
if committer_email == self.UserEmail: if committer_email == self.UserEmail:
last_mine = commit_id last_mine = commit_id
cnt_mine += 1 cnt_mine += 1
......
repo 100644 → 100755
File mode changed from 100644 to 100755
...@@ -21,6 +21,7 @@ import sys ...@@ -21,6 +21,7 @@ import sys
from command import InteractiveCommand from command import InteractiveCommand
from editor import Editor from editor import Editor
from error import HookError, UploadError from error import HookError, UploadError
import portable
from project import RepoHook from project import RepoHook
UNUSUAL_COMMIT_THRESHOLD = 5 UNUSUAL_COMMIT_THRESHOLD = 5
...@@ -186,9 +187,10 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ ...@@ -186,9 +187,10 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
len(commit_list) != 1 and 's' or '', len(commit_list) != 1 and 's' or '',
date)) date))
for commit in commit_list: for commit in commit_list:
print(' %s' % commit) print(' %s' % portable.stream2str(commit))
sys.stdout.write('to %s (y/N)? ' % remote.review) sys.stdout.write('to %s (y/N)? ' % remote.review)
sys.stdout.flush()
answer = sys.stdin.readline().strip().lower() answer = sys.stdin.readline().strip().lower()
answer = answer in ('y', 'yes', '1', 'true', 't') answer = answer in ('y', 'yes', '1', 'true', 't')
......
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