# HG changeset patch # User Yuya Nishihara # Date 1530325788 -32400 # Node ID 02004e5c6b566b1d0dbf1dc94eaf08c9aeb59569 # Parent 999e5c218daf300f8f217b6b5e3df0e7c4ef3511 rebase: isolate command options from internal flags I want to get rid of per-function byteskwargs(opts). diff -r 999e5c218daf -r 02004e5c6b56 hgext/rebase.py --- a/hgext/rebase.py Fri Jun 29 01:05:08 2018 +0530 +++ b/hgext/rebase.py Sat Jun 30 11:29:48 2018 +0900 @@ -819,31 +819,31 @@ opts[r'dest'] = '_destautoorphanrebase(SRC)' if dryrun: - return _dryrunrebase(ui, repo, **opts) + return _dryrunrebase(ui, repo, opts) elif inmemory: try: # in-memory merge doesn't support conflicts, so if we hit any, abort # and re-run as an on-disk merge. overrides = {('rebase', 'singletransaction'): True} with ui.configoverride(overrides, 'rebase'): - return _dorebase(ui, repo, inmemory=inmemory, **opts) + return _dorebase(ui, repo, opts, inmemory=inmemory) except error.InMemoryMergeConflictsError: ui.warn(_('hit merge conflicts; re-running rebase without in-memory' ' merge\n')) - _dorebase(ui, repo, abort=True) - return _dorebase(ui, repo, inmemory=False, **opts) + _dorebase(ui, repo, {r'abort': True}) + return _dorebase(ui, repo, opts, inmemory=False) else: - return _dorebase(ui, repo, **opts) + return _dorebase(ui, repo, opts) -def _dryrunrebase(ui, repo, **opts): +def _dryrunrebase(ui, repo, opts): rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=pycompat.byteskwargs(opts)) with repo.wlock(), repo.lock(): try: overrides = {('rebase', 'singletransaction'): True} with ui.configoverride(overrides, 'rebase'): - _origrebase(ui, repo, rbsrt, inmemory=True, - leaveunfinished=True, **opts) + _origrebase(ui, repo, opts, rbsrt, inmemory=True, + leaveunfinished=True) except error.InMemoryMergeConflictsError: ui.status(_('hit a merge conflict\n')) return 1 @@ -855,11 +855,11 @@ rbsrt._prepareabortorcontinue(isabort=True, backup=False, suppwarns=True) -def _dorebase(ui, repo, inmemory=False, **opts): +def _dorebase(ui, repo, opts, inmemory=False): rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts)) - return _origrebase(ui, repo, rbsrt, inmemory=inmemory, **opts) + return _origrebase(ui, repo, opts, rbsrt, inmemory=inmemory) -def _origrebase(ui, repo, rbsrt, inmemory=False, leaveunfinished=False, **opts): +def _origrebase(ui, repo, opts, rbsrt, inmemory=False, leaveunfinished=False): opts = pycompat.byteskwargs(opts) with repo.wlock(), repo.lock(): # Validate input and define rebasing points