Patchwork D7548: graft: extract `repo['.']` to local variable

login
register
mail settings
Submitter phabricator
Date Dec. 6, 2019, 3:37 p.m.
Message ID <2810e3eb54ddbc53e1bcddb30839904b@localhost.localdomain>
Download mbox | patch
Permalink /patch/43597/
State Not Applicable
Headers show

Comments

phabricator - Dec. 6, 2019, 3:37 p.m.
Closed by commit rHGfb07126dadbe: graft: extract `repo[&#039;.&#039;]` to local variable (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/D7548?vs=18473&id=18487

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

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -2605,7 +2605,8 @@ 
     # to copy commits), and 2) informs update that the incoming changes are
     # newer than the destination so it doesn't prompt about "remote changed foo
     # which local deleted".
-    mergeancestor = repo.changelog.isancestor(repo[b'.'].node(), ctx.node())
+    pctx = repo[b'.']
+    mergeancestor = repo.changelog.isancestor(pctx.node(), ctx.node())
 
     stats = update(
         repo,
@@ -2627,7 +2628,7 @@ 
             pother = parents[0].node()
 
     with repo.dirstate.parentchange():
-        repo.setparents(repo[b'.'].node(), pother)
+        repo.setparents(pctx.node(), pother)
         repo.dirstate.write(repo.currenttransaction())
         # fix up dirstate for copies and renames
         copies.duplicatecopies(repo, repo[None], ctx.rev(), base.rev())