Patchwork D2905: rebase: pass "inmemory" directly to _definedestmap()

login
register
mail settings
Submitter phabricator
Date March 20, 2018, 9:12 p.m.
Message ID <differential-rev-PHID-DREV-mdcqieh3nnewveamk36z-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/29678/
State Superseded
Headers show

Comments

phabricator - March 20, 2018, 9:12 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We no longer reassign rbsrt.inmemory in _definedestmap(), so we don't
  need to pass the whole rebase runtime instance anymore, thus
  making it clear that it won't be updated.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -840,8 +840,8 @@ 
             if retcode is not None:
                 return retcode
         else:
-            destmap = _definedestmap(ui, repo, rbsrt, destf, srcf, basef, revf,
-                                     destspace=destspace)
+            destmap = _definedestmap(ui, repo, inmemory, destf, srcf, basef,
+                                     revf, destspace=destspace)
             retcode = rbsrt._preparenewrebase(destmap)
             if retcode is not None:
                 return retcode
@@ -866,7 +866,7 @@ 
                 rbsrt._performrebase(tr)
                 rbsrt._finishrebase()
 
-def _definedestmap(ui, repo, rbsrt, destf=None, srcf=None, basef=None,
+def _definedestmap(ui, repo, inmemory, destf=None, srcf=None, basef=None,
                    revf=None, destspace=None):
     """use revisions argument to define destmap {srcrev: destrev}"""
     if revf is None:
@@ -881,7 +881,7 @@ 
     if revf and srcf:
         raise error.Abort(_('cannot specify both a revision and a source'))
 
-    if not rbsrt.inmemory:
+    if not inmemory:
         cmdutil.checkunfinished(repo)
         cmdutil.bailifchanged(repo)
 
@@ -959,7 +959,7 @@ 
 
     rebasingwcp = repo['.'].rev() in rebaseset
     ui.log("rebase", "", rebase_rebasing_wcp=rebasingwcp)
-    if rbsrt.inmemory and rebasingwcp:
+    if inmemory and rebasingwcp:
         # Check these since we did not before.
         cmdutil.checkunfinished(repo)
         cmdutil.bailifchanged(repo)