Patchwork D7896: rebase: extract a variable for a repeated `repo[p1]`

login
register
mail settings
Submitter phabricator
Date Jan. 16, 2020, 4:32 p.m.
Message ID <9c5456d1dbe24a750d034dcd93f89d30@localhost.localdomain>
Download mbox | patch
Permalink /patch/44444/
State Not Applicable
Headers show

Comments

phabricator - Jan. 16, 2020, 4:32 p.m.
Closed by commit rHG521b4e3a42d7: rebase: extract a variable for a repeated `repo[p1]` (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7896?vs=19332&id=19373

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7896/new/

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1469,11 +1469,12 @@ 
     """Rebase a single revision rev on top of p1 using base as merge ancestor"""
     # Merge phase
     # Update to destination and merge it with local
+    p1ctx = repo[p1]
     if wctx.isinmemory():
-        wctx.setbase(repo[p1])
+        wctx.setbase(p1ctx)
     else:
         if repo[b'.'].rev() != p1:
-            repo.ui.debug(b" update to %d:%s\n" % (p1, repo[p1]))
+            repo.ui.debug(b" update to %d:%s\n" % (p1, p1ctx))
             mergemod.update(repo, p1, branchmerge=False, force=True)
         else:
             repo.ui.debug(b" already in destination\n")