D1617: rebase: extract _assignworkingcopy

phillco (Phil Cohen) phabricator at mercurial-scm.org
Fri Dec 8 18:33:05 EST 2017


phillco updated this revision to Diff 4277.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1617?vs=4248&id=4277

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

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
@@ -382,14 +382,16 @@
 
         self.prepared = True
 
-    def _performrebase(self, tr):
-        repo, ui = self.repo, self.ui
-        # Assign a working copy object.
+    def _assignworkingcopy(self):
         if self.inmemory:
             from mercurial.context import overlayworkingctx
             self.wctx = overlayworkingctx(self.repo)
         else:
             self.wctx = self.repo[None]
+
+    def _performrebase(self, tr):
+        self._assignworkingcopy()
+        repo, ui = self.repo, self.ui
         if self.keepbranchesf:
             # insert _savebranch at the start of extrafns so if
             # there's a user-provided extrafn it can clobber branch if



To: phillco, #hg-reviewers, dlax
Cc: mercurial-devel


More information about the Mercurial-devel mailing list