Patchwork D7547: graft: rename `pctx` argument to `base` since that's what it is

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

Comments

phabricator - Dec. 6, 2019, 3:37 p.m.
Closed by commit rHGebfd349eac46: graft: rename `pctx` argument to `base` since that&#039;s what it is (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/D7547?vs=18472&id=18486

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

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

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
@@ -2582,7 +2582,7 @@ 
 
 
 def graft(
-    repo, ctx, pctx, labels=None, keepparent=False, keepconflictparent=False
+    repo, ctx, base, labels=None, keepparent=False, keepconflictparent=False
 ):
     """Do a graft-like merge.
 
@@ -2593,7 +2593,7 @@ 
     renames/copies appropriately.
 
     ctx - changeset to rebase
-    pctx - merge base, usually ctx.p1()
+    base - merge base, usually ctx.p1()
     labels - merge labels eg ['local', 'graft']
     keepparent - keep second parent if any
     keepconflictparent - if unresolved, keep parent used for the merge
@@ -2612,7 +2612,7 @@ 
         ctx.node(),
         True,
         True,
-        pctx.node(),
+        base.node(),
         mergeancestor=mergeancestor,
         labels=labels,
     )
@@ -2622,15 +2622,15 @@ 
     else:
         pother = nullid
         parents = ctx.parents()
-        if keepparent and len(parents) == 2 and pctx in parents:
-            parents.remove(pctx)
+        if keepparent and len(parents) == 2 and base in parents:
+            parents.remove(base)
             pother = parents[0].node()
 
     with repo.dirstate.parentchange():
         repo.setparents(repo[b'.'].node(), pother)
         repo.dirstate.write(repo.currenttransaction())
         # fix up dirstate for copies and renames
-        copies.duplicatecopies(repo, repo[None], ctx.rev(), pctx.rev())
+        copies.duplicatecopies(repo, repo[None], ctx.rev(), base.rev())
     return stats