graft: rename `pctx` argument to `base` since that's what it is
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 05 Dec 2019 09:32:47 -0800
changeset 43796 ebfd349eac46
parent 43795 0f6782df1100
child 43797 fb07126dadbe
graft: rename `pctx` argument to `base` since that's what it is The new name better matches the docstring. It also frees up `pctx` to be used for something else (next patch). Differential Revision: https://phab.mercurial-scm.org/D7547
mercurial/merge.py
--- a/mercurial/merge.py	Thu Dec 05 08:59:23 2019 -0800
+++ b/mercurial/merge.py	Thu Dec 05 09:32:47 2019 -0800
@@ -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