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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Mar 20 21:12:07 UTC 2018


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

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)



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


More information about the Mercurial-devel mailing list