##// END OF EJS Templates
rebase: extract dryrun as a function...
Sushil khanchi -
r38515:c92fdc27 default
parent child Browse files
Show More
@@ -818,6 +818,23 b' def rebase(ui, repo, **opts):'
818 opts[r'dest'] = '_destautoorphanrebase(SRC)'
818 opts[r'dest'] = '_destautoorphanrebase(SRC)'
819
819
820 if dryrun:
820 if dryrun:
821 return _dryrunrebase(ui, repo, **opts)
822 elif inmemory:
823 try:
824 # in-memory merge doesn't support conflicts, so if we hit any, abort
825 # and re-run as an on-disk merge.
826 overrides = {('rebase', 'singletransaction'): True}
827 with ui.configoverride(overrides, 'rebase'):
828 return _origrebase(ui, repo, inmemory=inmemory, **opts)
829 except error.InMemoryMergeConflictsError:
830 ui.warn(_('hit merge conflicts; re-running rebase without in-memory'
831 ' merge\n'))
832 _origrebase(ui, repo, abort=True)
833 return _origrebase(ui, repo, inmemory=False, **opts)
834 else:
835 return _origrebase(ui, repo, **opts)
836
837 def _dryrunrebase(ui, repo, **opts):
821 rbsrt = rebaseruntime(repo, ui, inmemory=True,
838 rbsrt = rebaseruntime(repo, ui, inmemory=True,
822 opts=pycompat.byteskwargs(opts))
839 opts=pycompat.byteskwargs(opts))
823 with repo.wlock(), repo.lock():
840 with repo.wlock(), repo.lock():
@@ -834,20 +851,6 b' def rebase(ui, repo, **opts):'
834 return 0
851 return 0
835 finally:
852 finally:
836 rbsrt._prepareabortorcontinue(isabort=True)
853 rbsrt._prepareabortorcontinue(isabort=True)
837 elif inmemory:
838 try:
839 # in-memory merge doesn't support conflicts, so if we hit any, abort
840 # and re-run as an on-disk merge.
841 overrides = {('rebase', 'singletransaction'): True}
842 with ui.configoverride(overrides, 'rebase'):
843 return _origrebase(ui, repo, inmemory=inmemory, **opts)
844 except error.InMemoryMergeConflictsError:
845 ui.warn(_('hit merge conflicts; re-running rebase without in-memory'
846 ' merge\n'))
847 _origrebase(ui, repo, abort=True)
848 return _origrebase(ui, repo, inmemory=False, **opts)
849 else:
850 return _origrebase(ui, repo, **opts)
851
854
852 def _origrebase(ui, repo, inmemory=False, leaveunfinished=False, rbsrt=None,
855 def _origrebase(ui, repo, inmemory=False, leaveunfinished=False, rbsrt=None,
853 **opts):
856 **opts):
General Comments 0
You need to be logged in to leave comments. Login now