rebase: get "inmemory" state directly from rebase runtime
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 20 Mar 2018 17:30:08 -0700
changeset 37027 81b35d275a60
parent 37026 e2a0aaec7d86
child 37028 36c4e25c3ce1
rebase: get "inmemory" state directly from rebase runtime As far as I can tell, rbsrt.inmemory is equivalent to rbsrt.wctx.isinmemory(), so let's use the shorter form. Differential Revision: https://phab.mercurial-scm.org/D2908
hgext/rebase.py
--- a/hgext/rebase.py	Mon Dec 25 15:56:07 2017 +0530
+++ b/hgext/rebase.py	Tue Mar 20 17:30:08 2018 -0700
@@ -390,7 +390,7 @@
         else:
             self.wctx = self.repo[None]
             self.repo.ui.debug("rebasing on disk\n")
-        self.repo.ui.log("rebase", "", rebase_imm_used=self.wctx.isinmemory())
+        self.repo.ui.log("rebase", "", rebase_imm_used=self.inmemory)
 
     def _performrebase(self, tr):
         self._assignworkingcopy()
@@ -489,7 +489,7 @@
                     stats = rebasenode(repo, rev, p1, base, self.collapsef,
                                        dest, wctx=self.wctx)
                     if stats[3] > 0:
-                        if self.wctx.isinmemory():
+                        if self.inmemory:
                             raise error.InMemoryMergeConflictsError()
                         else:
                             raise error.InterventionRequired(
@@ -500,7 +500,7 @@
                 editform = cmdutil.mergeeditform(merging, 'rebase')
                 editor = cmdutil.getcommiteditor(editform=editform,
                                                  **pycompat.strkwargs(opts))
-                if self.wctx.isinmemory():
+                if self.inmemory:
                     newnode = concludememorynode(repo, rev, p1, p2,
                         wctx=self.wctx,
                         extrafn=_makeextrafn(self.extrafns),
@@ -522,7 +522,7 @@
                     mergemod.mergestate.clean(repo)
             else:
                 # Skip commit if we are collapsing
-                if self.wctx.isinmemory():
+                if self.inmemory:
                     self.wctx.setbase(repo[p1])
                 else:
                     repo.setparents(repo[p1].node())