merge: if filemerge skips merge, report as updated
authorMatt Mackall <mpm@selenic.com>
Sun, 15 Oct 2006 16:18:09 -0500
changeset 3400 d2b55e3c4e25
parent 3399 5dbb3a991bbf
child 3408 4e0c08f019b8
child 3412 f2de6b6bc57a
merge: if filemerge skips merge, report as updated
mercurial/merge.py
tests/test-merge-revert.out
tests/test-merge1.out
tests/test-rename-merge2.out
tests/test-up-local-change.out
--- a/mercurial/merge.py	Sun Oct 15 21:09:56 2006 +0200
+++ b/mercurial/merge.py	Sun Oct 15 16:18:09 2006 -0500
@@ -30,7 +30,7 @@
     fco = mctx.filectx(fo)
 
     if not fco.cmp(fcm.data()): # files identical?
-        return 0
+        return None
 
     fca = fcm.ancestor(fco)
     if not fca:
@@ -288,10 +288,14 @@
             removed +=1
         elif m == "m": # merge
             f2, fd, flag, move = a[2:]
-            if filemerge(repo, f, f2, wctx, mctx):
+            r = filemerge(repo, f, f2, wctx, mctx)
+            if r > 0:
                 unresolved += 1
             else:
-                merged += 1
+                if r is None:
+                    updated += 1
+                else:
+                    merged += 1
                 if f != fd:
                     repo.ui.debug(_("copying %s to %s\n") % (f, fd))
                     repo.wwrite(fd, repo.wread(f))
--- a/tests/test-merge-revert.out	Sun Oct 15 21:09:56 2006 +0200
+++ b/tests/test-merge-revert.out	Sun Oct 15 16:18:09 2006 -0500
@@ -11,7 +11,7 @@
 ? file1.orig
 016807e6fdaf tip
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 ? file1.orig
 016807e6fdaf tip
 ? file1.orig
--- a/tests/test-merge1.out	Sun Oct 15 21:09:56 2006 +0200
+++ b/tests/test-merge1.out	Sun Oct 15 16:18:09 2006 -0500
@@ -1,6 +1,6 @@
 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 %% no merges expected
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 diff -r d9e5953b9dec b
 --- /dev/null
@@ -29,7 +29,7 @@
 %% merge fails
 abort: outstanding uncommitted changes
 %% merge expected!
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 diff -r c1dd73cbf59f b
 --- a/b
--- a/tests/test-rename-merge2.out	Sun Oct 15 21:09:56 2006 +0200
+++ b/tests/test-rename-merge2.out	Sun Oct 15 16:18:09 2006 -0500
@@ -92,7 +92,7 @@
 copying a to b
 merging rev
 my rev@94b33a1b7f2d+ other rev@735846fee2d7 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+1 files updated, 1 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
 M b
@@ -110,7 +110,7 @@
  rev: versions differ -> m
 merging rev
 my rev@ac809aeed39a+ other rev@97c705ade336 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+1 files updated, 1 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
 M b
@@ -130,7 +130,7 @@
 removing a
 merging rev
 my rev@94b33a1b7f2d+ other rev@e03727d2d66b ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+1 files updated, 1 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
 M b
@@ -147,7 +147,7 @@
  rev: versions differ -> m
 merging rev
 my rev@ecf3cb2a4219+ other rev@97c705ade336 ancestor rev@924404dff337
-0 files updated, 2 files merged, 0 files removed, 0 files unresolved
+1 files updated, 1 files merged, 0 files removed, 0 files unresolved
 (branch merge, don't forget to commit)
 --------------
 M b
--- a/tests/test-up-local-change.out	Sun Oct 15 21:09:56 2006 +0200
+++ b/tests/test-up-local-change.out	Sun Oct 15 16:18:09 2006 -0500
@@ -133,4 +133,4 @@
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved