Patchwork D3856: rebase: split _origrebase() for conveniece in dryrun

login
register
mail settings
Submitter phabricator
Date June 29, 2018, 6:09 p.m.
Message ID <6682e875f98e0fe439adb63fb656aeb8@localhost.localdomain>
Download mbox | patch
Permalink /patch/32505/
State Not Applicable
Headers show

Comments

phabricator - June 29, 2018, 6:09 p.m.
khanchi97 updated this revision to Diff 9356.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3856?vs=9344&id=9356

REVISION DETAIL
  https://phab.mercurial-scm.org/D3856

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: khanchi97, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -825,22 +825,22 @@ 
             # and re-run as an on-disk merge.
             overrides = {('rebase', 'singletransaction'): True}
             with ui.configoverride(overrides, 'rebase'):
-                return _origrebase(ui, repo, inmemory=inmemory, **opts)
+                return _dorebase(ui, repo, inmemory=inmemory, **opts)
         except error.InMemoryMergeConflictsError:
             ui.warn(_('hit merge conflicts; re-running rebase without in-memory'
                       ' merge\n'))
-            _origrebase(ui, repo, abort=True)
-            return _origrebase(ui, repo, inmemory=False, **opts)
+            _dorebase(ui, repo, abort=True)
+            return _dorebase(ui, repo, inmemory=False, **opts)
     else:
-        return _origrebase(ui, repo, **opts)
+        return _dorebase(ui, repo, **opts)
 
 def _dryrunrebase(ui, repo, **opts):
     rbsrt = rebaseruntime(repo, ui, inmemory=True, opts=opts)
     with repo.wlock(), repo.lock():
         try:
             overrides = {('rebase', 'singletransaction'): True}
             with ui.configoverride(overrides, 'rebase'):
-                _origrebase(ui, repo, inmemory=True, rbsrt=rbsrt,
+                _origrebase(ui, repo, rbsrt, inmemory=True,
                             leaveunfinished=True, **opts)
         except error.InMemoryMergeConflictsError:
             ui.status(_('hit a merge conflict\n'))
@@ -851,12 +851,12 @@ 
         finally:
             rbsrt._prepareabortorcontinue(isabort=True)
 
-def _origrebase(ui, repo, inmemory=False, leaveunfinished=False, rbsrt=None,
-                **opts):
+def _dorebase(ui, repo, inmemory=False, **opts):
     opts = pycompat.byteskwargs(opts)
-    if not rbsrt:
-        rbsrt = rebaseruntime(repo, ui, inmemory, opts)
-
+    rbsrt = rebaseruntime(repo, ui, inmemory, opts)
+    return _origrebase(ui, repo, rbsrt, inmemory=inmemory, **opts)
+
+def _origrebase(ui, repo, rbsrt, inmemory=False, leaveunfinished=False, **opts):
     with repo.wlock(), repo.lock():
         # Validate input and define rebasing points
         destf = opts.get('dest', None)