filemerge: use contexts rather than my and other
authorMatt Mackall <mpm@selenic.com>
Mon, 09 Oct 2006 21:27:04 -0500
changeset 3299 e7abcf3a7c5f
parent 3298 45f0c49f0449
child 3300 642e5faf6bf0
filemerge: use contexts rather than my and other
mercurial/merge.py
tests/test-merge7.out
tests/test-rename-merge1.out
tests/test-rename-merge2.out
tests/test-up-local-change.out
--- a/mercurial/merge.py	Mon Oct 09 21:04:25 2006 -0500
+++ b/mercurial/merge.py	Mon Oct 09 21:27:04 2006 -0500
@@ -10,7 +10,7 @@
 from demandload import *
 demandload(globals(), "errno util os tempfile")
 
-def filemerge(repo, fw, fo, fd, my, other, wctx, mctx, move):
+def filemerge(repo, fw, fo, fd, wctx, mctx, move):
     """perform a 3-way merge in the working directory
 
     fw = filename in the working directory and first parent
@@ -34,8 +34,8 @@
         f.close()
         return name
 
-    fcm = repo.filectx(fw, fileid=my)
-    fco = repo.filectx(fo, fileid=other)
+    fcm = wctx.filectx(fw)
+    fco = mctx.filectx(fo)
     fca = fcm.ancestor(fco)
     if not fca:
         fca = repo.filectx(fw, fileid=-1)
@@ -295,14 +295,14 @@
         elif m == "c": # copy
             f2, fd, my, other, flag, move = a[2:]
             repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd))
-            if filemerge(repo, f, f2, fd, my, other, wctx, mctx, move):
+            if filemerge(repo, f, f2, fd, wctx, mctx, move):
                 unresolved += 1
             util.set_exec(repo.wjoin(fd), flag)
             merged += 1
         elif m == "m": # merge
             flag, my, other = a[2:]
             repo.ui.status(_("merging %s\n") % f)
-            if filemerge(repo, f, f, f, my, other, wctx, mctx, False):
+            if filemerge(repo, f, f, f, wctx, mctx, False):
                 unresolved += 1
             util.set_exec(repo.wjoin(f), flag)
             merged += 1
--- a/tests/test-merge7.out	Mon Oct 09 21:04:25 2006 -0500
+++ b/tests/test-merge7.out	Mon Oct 09 21:27:04 2006 -0500
@@ -27,7 +27,7 @@
  test.txt: versions differ -> m
 merging test.txt
 resolving test.txt
-my test.txt@451c744aabcc other test.txt@a070d41e8360 ancestor test.txt@faaea63e63a9
+my test.txt@. other test.txt@a070d41e8360 ancestor test.txt@faaea63e63a9
 merging test.txt failed!
 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
 There are unresolved merges, you can redo the full merge using:
--- a/tests/test-rename-merge1.out	Mon Oct 09 21:04:25 2006 -0500
+++ b/tests/test-rename-merge1.out	Mon Oct 09 21:27:04 2006 -0500
@@ -8,7 +8,7 @@
  b2: remote created -> g
 merging a and b to b
 resolving a
-my a@f26ec4fc3fa3 other b@8e765a822af2 ancestor a@af1939970a1c
+my a@. other b@8e765a822af2 ancestor a@af1939970a1c
 copying a to b
 removing a
 getting b2
--- a/tests/test-rename-merge2.out	Mon Oct 09 21:04:25 2006 -0500
+++ b/tests/test-rename-merge2.out	Mon Oct 09 21:27:04 2006 -0500
@@ -8,11 +8,11 @@
  a: remote copied -> c
 merging a and b to b
 resolving a
-my a@e300d1c794ec other b@735846fee2d7 ancestor a@924404dff337
+my a@. other b@735846fee2d7 ancestor a@924404dff337
 copying a to b
 merging rev
 resolving rev
-my rev@e300d1c794ec other rev@735846fee2d7 ancestor rev@924404dff337
+my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -33,10 +33,10 @@
 getting a
 merging b and a to b
 resolving b
-my b@ac809aeed39a other a@f4db7e329e71 ancestor a@924404dff337
+my b@. other a@f4db7e329e71 ancestor a@924404dff337
 merging rev
 resolving rev
-my rev@ac809aeed39a other rev@f4db7e329e71 ancestor rev@924404dff337
+my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -55,12 +55,12 @@
  rev: versions differ -> m
 merging a and b to b
 resolving a
-my a@e300d1c794ec other b@e03727d2d66b ancestor a@924404dff337
+my a@. other b@e03727d2d66b ancestor a@924404dff337
 copying a to b
 removing a
 merging rev
 resolving rev
-my rev@e300d1c794ec other rev@e03727d2d66b ancestor rev@924404dff337
+my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -78,10 +78,10 @@
  rev: versions differ -> m
 merging b and a to b
 resolving b
-my b@ecf3cb2a4219 other a@f4db7e329e71 ancestor a@924404dff337
+my b@. other a@f4db7e329e71 ancestor a@924404dff337
 merging rev
 resolving rev
-my rev@ecf3cb2a4219 other rev@f4db7e329e71 ancestor rev@924404dff337
+my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -99,11 +99,11 @@
  a: remote copied -> c
 merging a and b to b
 resolving a
-my a@924404dff337 other b@735846fee2d7 ancestor a@924404dff337
+my a@. other b@735846fee2d7 ancestor a@924404dff337
 copying a to b
 merging rev
 resolving rev
-my rev@94b33a1b7f2d other rev@735846fee2d7 ancestor rev@924404dff337
+my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -122,10 +122,10 @@
  rev: versions differ -> m
 merging b and a to b
 resolving b
-my b@ac809aeed39a other a@924404dff337 ancestor a@924404dff337
+my b@. other a@97c705ade336 ancestor a@924404dff337
 merging rev
 resolving rev
-my rev@ac809aeed39a other rev@97c705ade336 ancestor rev@924404dff337
+my rev@. other rev@97c705ade336 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -144,12 +144,12 @@
  rev: versions differ -> m
 merging a and b to b
 resolving a
-my a@924404dff337 other b@e03727d2d66b ancestor a@924404dff337
+my a@. other b@e03727d2d66b ancestor a@924404dff337
 copying a to b
 removing a
 merging rev
 resolving rev
-my rev@94b33a1b7f2d other rev@e03727d2d66b ancestor rev@924404dff337
+my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -167,10 +167,10 @@
  rev: versions differ -> m
 merging b and a to b
 resolving b
-my b@ecf3cb2a4219 other a@924404dff337 ancestor a@924404dff337
+my b@. other a@97c705ade336 ancestor a@924404dff337
 merging rev
 resolving rev
-my rev@ecf3cb2a4219 other rev@97c705ade336 ancestor rev@924404dff337
+my rev@. other rev@97c705ade336 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -188,10 +188,10 @@
  rev: versions differ -> m
 merging b
 resolving b
-my b@ec03c2ca8642 other b@79cc6877a3b7 ancestor a@924404dff337
+my b@. other b@79cc6877a3b7 ancestor a@924404dff337
 merging rev
 resolving rev
-my rev@ec03c2ca8642 other rev@79cc6877a3b7 ancestor rev@924404dff337
+my rev@. other rev@79cc6877a3b7 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -209,7 +209,7 @@
 getting c
 merging rev
 resolving rev
-my rev@ecf3cb2a4219 other rev@e6abcc1a30c2 ancestor rev@924404dff337
+my rev@. other rev@e6abcc1a30c2 ancestor rev@924404dff337
 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -227,10 +227,10 @@
  rev: versions differ -> m
 merging b
 resolving b
-my b@ac809aeed39a other b@af30c7647fc7 ancestor b@000000000000
+my b@. other b@af30c7647fc7 ancestor b@000000000000
 merging rev
 resolving rev
-my rev@ac809aeed39a other rev@af30c7647fc7 ancestor rev@924404dff337
+my rev@. other rev@af30c7647fc7 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -250,10 +250,10 @@
 removing a
 merging b
 resolving b
-my b@59318016310c other b@e03727d2d66b ancestor b@000000000000
+my b@. other b@e03727d2d66b ancestor b@000000000000
 merging rev
 resolving rev
-my rev@59318016310c other rev@e03727d2d66b ancestor rev@924404dff337
+my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -272,10 +272,10 @@
 getting a
 merging b
 resolving b
-my b@ac809aeed39a other b@8dbce441892a ancestor b@000000000000
+my b@. other b@8dbce441892a ancestor b@000000000000
 merging rev
 resolving rev
-my rev@ac809aeed39a other rev@8dbce441892a ancestor rev@924404dff337
+my rev@. other rev@8dbce441892a ancestor rev@924404dff337
 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -295,10 +295,10 @@
 removing a
 merging b
 resolving b
-my b@59318016310c other b@e03727d2d66b ancestor b@000000000000
+my b@. other b@e03727d2d66b ancestor b@000000000000
 merging rev
 resolving rev
-my rev@59318016310c other rev@e03727d2d66b ancestor rev@924404dff337
+my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -317,10 +317,10 @@
 getting a
 merging b
 resolving b
-my b@ac809aeed39a other b@8dbce441892a ancestor b@000000000000
+my b@. other b@8dbce441892a ancestor b@000000000000
 merging rev
 resolving rev
-my rev@ac809aeed39a other rev@8dbce441892a ancestor rev@924404dff337
+my rev@. other rev@8dbce441892a ancestor rev@924404dff337
 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -338,10 +338,10 @@
  rev: versions differ -> m
 merging b
 resolving b
-my b@0b76e65c8289 other b@735846fee2d7 ancestor b@000000000000
+my b@. other b@735846fee2d7 ancestor b@000000000000
 merging rev
 resolving rev
-my rev@0b76e65c8289 other rev@735846fee2d7 ancestor rev@924404dff337
+my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -361,10 +361,10 @@
 getting a
 merging b
 resolving b
-my b@ecf3cb2a4219 other b@8dbce441892a ancestor b@000000000000
+my b@. other b@8dbce441892a ancestor b@000000000000
 merging rev
 resolving rev
-my rev@ecf3cb2a4219 other rev@8dbce441892a ancestor rev@924404dff337
+my rev@. other rev@8dbce441892a ancestor rev@924404dff337
 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -382,10 +382,10 @@
  rev: versions differ -> m
 merging b
 resolving b
-my b@0b76e65c8289 other b@e03727d2d66b ancestor b@000000000000
+my b@. other b@e03727d2d66b ancestor b@000000000000
 merging rev
 resolving rev
-my rev@0b76e65c8289 other rev@e03727d2d66b ancestor rev@924404dff337
+my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -403,12 +403,12 @@
  rev: versions differ -> m
 merging a and b to b
 resolving a
-my a@e300d1c794ec other b@79cc6877a3b7 ancestor a@924404dff337
+my a@. other b@79cc6877a3b7 ancestor a@924404dff337
 copying a to b
 removing a
 merging rev
 resolving rev
-my rev@e300d1c794ec other rev@79cc6877a3b7 ancestor rev@924404dff337
+my rev@. other rev@79cc6877a3b7 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -426,10 +426,10 @@
  rev: versions differ -> m
 merging b and a to b
 resolving b
-my b@ec03c2ca8642 other a@f4db7e329e71 ancestor a@924404dff337
+my b@. other a@f4db7e329e71 ancestor a@924404dff337
 merging rev
 resolving rev
-my rev@ec03c2ca8642 other rev@f4db7e329e71 ancestor rev@924404dff337
+my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
@@ -448,11 +448,11 @@
  c: remote created -> g
 merging b and a to b
 resolving b
-my b@ecf3cb2a4219 other a@2b958612230f ancestor a@924404dff337
+my b@. other a@2b958612230f ancestor a@924404dff337
 getting c
 merging rev
 resolving rev
-my rev@ecf3cb2a4219 other rev@2b958612230f ancestor rev@924404dff337
+my rev@. other rev@2b958612230f ancestor rev@924404dff337
 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
--- a/tests/test-up-local-change.out	Mon Oct 09 21:04:25 2006 -0500
+++ b/tests/test-up-local-change.out	Mon Oct 09 21:27:04 2006 -0500
@@ -21,7 +21,7 @@
  b: remote created -> g
 merging a
 resolving a
-my a@33aaa84a386b other a@802f095af299 ancestor a@33aaa84a386b
+my a@. other a@802f095af299 ancestor a@33aaa84a386b
 getting b
 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
 changeset:   1:802f095af299
@@ -55,7 +55,7 @@
  b: remote created -> g
 merging a
 resolving a
-my a@33aaa84a386b other a@802f095af299 ancestor a@33aaa84a386b
+my a@. other a@802f095af299 ancestor a@33aaa84a386b
 getting b
 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
 changeset:   1:802f095af299
@@ -106,10 +106,10 @@
  b: versions differ -> m
 merging a
 resolving a
-my a@802f095af299 other a@030602aee63d ancestor a@33aaa84a386b
+my a@. other a@030602aee63d ancestor a@33aaa84a386b
 merging b
 resolving b
-my b@802f095af299 other b@030602aee63d ancestor b@000000000000
+my b@. other b@030602aee63d ancestor b@000000000000
 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 changeset:   1:802f095af299