We add r'' prefixes to prevent the transformer adding b'' prefixes.
- skip-blame because just r'' prefixes
hg-reviewers |
We add r'' prefixes to prevent the transformer adding b'' prefixes.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Return Values: | Return Values: | ||||
Returns 0 on success, 1 if nothing to rebase or there are | Returns 0 on success, 1 if nothing to rebase or there are | ||||
unresolved conflicts. | unresolved conflicts. | ||||
""" | """ | ||||
inmemory = ui.configbool('rebase', 'experimental.inmemory') | inmemory = ui.configbool('rebase', 'experimental.inmemory') | ||||
if (opts.get('continue') or opts.get('abort') or | if (opts.get(r'continue') or opts.get(r'abort') or | ||||
repo.currenttransaction() is not None): | repo.currenttransaction() is not None): | ||||
# in-memory rebase is not compatible with resuming rebases. | # in-memory rebase is not compatible with resuming rebases. | ||||
# (Or if it is run within a transaction, since the restart logic can | # (Or if it is run within a transaction, since the restart logic can | ||||
# fail the entire transaction.) | # fail the entire transaction.) | ||||
inmemory = False | inmemory = False | ||||
if opts.get('auto_orphans'): | if opts.get(r'auto_orphans'): | ||||
for key in opts: | for key in opts: | ||||
if key != 'auto_orphans' and opts.get(key): | if key != r'auto_orphans' and opts.get(key): | ||||
raise error.Abort(_('--auto-orphans is incompatible with %s') % | raise error.Abort(_('--auto-orphans is incompatible with %s') % | ||||
('--' + key)) | ('--' + key)) | ||||
userrevs = list(repo.revs(opts.get('auto_orphans'))) | userrevs = list(repo.revs(opts.get(r'auto_orphans'))) | ||||
opts['rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)] | opts[r'rev'] = [revsetlang.formatspec('%ld and orphan()', userrevs)] | ||||
opts['dest'] = '_destautoorphanrebase(SRC)' | opts[r'dest'] = '_destautoorphanrebase(SRC)' | ||||
if inmemory: | if inmemory: | ||||
try: | try: | ||||
# in-memory merge doesn't support conflicts, so if we hit any, abort | # in-memory merge doesn't support conflicts, so if we hit any, abort | ||||
# and re-run as an on-disk merge. | # and re-run as an on-disk merge. | ||||
overrides = {('rebase', 'singletransaction'): True} | overrides = {('rebase', 'singletransaction'): True} | ||||
with ui.configoverride(overrides, 'rebase'): | with ui.configoverride(overrides, 'rebase'): | ||||
return _origrebase(ui, repo, inmemory=inmemory, **opts) | return _origrebase(ui, repo, inmemory=inmemory, **opts) | ||||
except error.InMemoryMergeConflictsError: | except error.InMemoryMergeConflictsError: | ||||
ui.warn(_('hit merge conflicts; re-running rebase without in-memory' | ui.warn(_('hit merge conflicts; re-running rebase without in-memory' | ||||
' merge\n')) | ' merge\n')) | ||||
_origrebase(ui, repo, **{'abort': True}) | _origrebase(ui, repo, **{r'abort': True}) | ||||
return _origrebase(ui, repo, inmemory=False, **opts) | return _origrebase(ui, repo, inmemory=False, **opts) | ||||
else: | else: | ||||
return _origrebase(ui, repo, **opts) | return _origrebase(ui, repo, **opts) | ||||
def _origrebase(ui, repo, inmemory=False, **opts): | def _origrebase(ui, repo, inmemory=False, **opts): | ||||
opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
rbsrt = rebaseruntime(repo, ui, inmemory, opts) | rbsrt = rebaseruntime(repo, ui, inmemory, opts) | ||||