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

login
register
mail settings
Submitter phabricator
Date June 30, 2018, 1:47 a.m.
Message ID <8eabb925e99581443fe9030a33c4c830@localhost.localdomain>
Download mbox | patch
Permalink /patch/32520/
State Not Applicable
Headers show

Comments

phabricator - June 30, 2018, 1:47 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9c3b48fb7ac5: rebase: split _origrebase() for conveniece in dryrun (authored by khanchi97, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D3856?vs=9356&id=9371#toc

REPOSITORY
  rHG Mercurial

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

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,23 +825,23 @@ 
             # 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=pycompat.byteskwargs(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'))
@@ -852,12 +852,12 @@ 
         finally:
             rbsrt._prepareabortorcontinue(isabort=True)
 
-def _origrebase(ui, repo, inmemory=False, leaveunfinished=False, rbsrt=None,
-                **opts):
+def _dorebase(ui, repo, inmemory=False, **opts):
+    rbsrt = rebaseruntime(repo, ui, inmemory, pycompat.byteskwargs(opts))
+    return _origrebase(ui, repo, rbsrt, inmemory=inmemory, **opts)
+
+def _origrebase(ui, repo, rbsrt, inmemory=False, leaveunfinished=False, **opts):
     opts = pycompat.byteskwargs(opts)
-    if not rbsrt:
-        rbsrt = rebaseruntime(repo, ui, inmemory, opts)
-
     with repo.wlock(), repo.lock():
         # Validate input and define rebasing points
         destf = opts.get('dest', None)