changeset 18611:18c2184c27dc

merge: rename p1 to wctx in manifestmerge This is always a workingctx, and this name is more in line with other functions in this module.
author Bryan O'Sullivan <bryano@fb.com>
date Sat, 09 Feb 2013 21:24:24 +0000
parents 46edbc49a9f2
children 0b6e6eacc939
files mercurial/merge.py
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Sat Feb 09 16:02:01 2013 +0000
+++ b/mercurial/merge.py	Sat Feb 09 21:24:24 2013 +0000
@@ -185,7 +185,7 @@
 
     return actions
 
-def manifestmerge(repo, p1, p2, pa, branchmerge, force, partial):
+def manifestmerge(repo, wctx, p2, pa, branchmerge, force, partial):
     """
     Merge p1 and p2 with ancestor pa and generate merge action list
 
@@ -197,11 +197,11 @@
     actions, copy, movewithdir = [], {}, {}
 
     if overwrite:
-        pa = p1
+        pa = wctx
     elif pa == p2: # backwards
-        pa = p1.p1()
+        pa = wctx.p1()
     elif pa and repo.ui.configbool("merge", "followcopies", True):
-        ret = copies.mergecopies(repo, p1, p2, pa)
+        ret = copies.mergecopies(repo, wctx, p2, pa)
         copy, movewithdir, diverge, renamedelete = ret
         for of, fl in diverge.iteritems():
             actions.append((of, "dr", (fl,), "divergent renames"))
@@ -211,16 +211,16 @@
     repo.ui.note(_("resolving manifests\n"))
     repo.ui.debug(" branchmerge: %s, force: %s, partial: %s\n"
                   % (bool(branchmerge), bool(force), bool(partial)))
-    repo.ui.debug(" ancestor: %s, local: %s, remote: %s\n" % (pa, p1, p2))
+    repo.ui.debug(" ancestor: %s, local: %s, remote: %s\n" % (pa, wctx, p2))
 
-    m1, m2, ma = p1.manifest(), p2.manifest(), pa.manifest()
+    m1, m2, ma = wctx.manifest(), p2.manifest(), pa.manifest()
     copied = set(copy.values())
     copied.update(movewithdir.values())
 
     if '.hgsubstate' in m1:
         # check whether sub state is modified
-        for s in sorted(p1.substate):
-            if p1.sub(s).dirty():
+        for s in sorted(wctx.substate):
+            if wctx.sub(s).dirty():
                 m1['.hgsubstate'] += "+"
                 break
 
@@ -300,7 +300,7 @@
             if force and not branchmerge:
                 actions.append((f, "g", (m2.flags(f),), "remote created"))
             else:
-                different = _checkunknownfile(repo, p1, p2, f)
+                different = _checkunknownfile(repo, wctx, p2, f)
                 if force and branchmerge and different:
                     actions.append((f, "m", (f, f, False),
                                     "remote differs from untracked local"))