comparison hgext/rebase.py @ 38064:46e8abc4eb04

py3: fix kwargs handling in hgext/rebase.py We add r'' prefixes to prevent the transformer adding b'' prefixes. # skip-blame because just r'' prefixes Differential Revision: https://phab.mercurial-scm.org/D3616
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 19 May 2018 21:46:54 +0530
parents 92213f6745ed
children 64280cd4b454
comparison
equal deleted inserted replaced
38063:3c995af3066e 38064:46e8abc4eb04
796 Returns 0 on success, 1 if nothing to rebase or there are 796 Returns 0 on success, 1 if nothing to rebase or there are
797 unresolved conflicts. 797 unresolved conflicts.
798 798
799 """ 799 """
800 inmemory = ui.configbool('rebase', 'experimental.inmemory') 800 inmemory = ui.configbool('rebase', 'experimental.inmemory')
801 if (opts.get('continue') or opts.get('abort') or 801 if (opts.get(r'continue') or opts.get(r'abort') or
802 repo.currenttransaction() is not None): 802 repo.currenttransaction() is not None):
803 # in-memory rebase is not compatible with resuming rebases. 803 # in-memory rebase is not compatible with resuming rebases.
804 # (Or if it is run within a transaction, since the restart logic can 804 # (Or if it is run within a transaction, since the restart logic can
805 # fail the entire transaction.) 805 # fail the entire transaction.)
806 inmemory = False 806 inmemory = False
807 807
808 if opts.get('auto_orphans'): 808 if opts.get(r'auto_orphans'):
809 for key in opts: 809 for key in opts:
810 if key != 'auto_orphans' and opts.get(key): 810 if key != r'auto_orphans' and opts.get(key):
811 raise error.Abort(_('--auto-orphans is incompatible with %s') % 811 raise error.Abort(_('--auto-orphans is incompatible with %s') %
812 ('--' + key)) 812 ('--' + key))
813 userrevs = list(repo.revs(opts.get('auto_orphans'))) 813 userrevs = list(repo.revs(opts.get(r'auto_orphans')))
814 opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)] 814 opts[r'rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)]
815 opts['dest'] = '_destautoorphanrebase(SRC)' 815 opts[r'dest'] = '_destautoorphanrebase(SRC)'
816 816
817 if inmemory: 817 if inmemory:
818 try: 818 try:
819 # in-memory merge doesn't support conflicts, so if we hit any, abort 819 # in-memory merge doesn't support conflicts, so if we hit any, abort
820 # and re-run as an on-disk merge. 820 # and re-run as an on-disk merge.
822 with ui.configoverride(overrides, 'rebase'): 822 with ui.configoverride(overrides, 'rebase'):
823 return _origrebase(ui, repo, inmemory=inmemory, **opts) 823 return _origrebase(ui, repo, inmemory=inmemory, **opts)
824 except error.InMemoryMergeConflictsError: 824 except error.InMemoryMergeConflictsError:
825 ui.warn(_('hit merge conflicts; re-running rebase without in-memory' 825 ui.warn(_('hit merge conflicts; re-running rebase without in-memory'
826 ' merge\n')) 826 ' merge\n'))
827 _origrebase(ui, repo, **{'abort': True}) 827 _origrebase(ui, repo, **{r'abort': True})
828 return _origrebase(ui, repo, inmemory=False, **opts) 828 return _origrebase(ui, repo, inmemory=False, **opts)
829 else: 829 else:
830 return _origrebase(ui, repo, **opts) 830 return _origrebase(ui, repo, **opts)
831 831
832 def _origrebase(ui, repo, inmemory=False, **opts): 832 def _origrebase(ui, repo, inmemory=False, **opts):