Fix local file changes being ignored after non-branch merge
authormpm@selenic.com
Sat, 23 Jul 2005 10:00:56 -0500
changeset 768 20e95c245bc3
parent 767 61ed30e82b27
child 769 0c033ef053ab
Fix local file changes being ignored after non-branch merge Bug introduced in eea96285cbf9 Spotted by TAH
mercurial/hg.py
tests/test-up-local-change.out
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -1506,7 +1506,9 @@ class localrepository:
             m, o, flag = merge[f]
             self.merge3(f, m, o)
             util.set_exec(self.wjoin(f), flag)
-            if moddirstate:
+            if moddirstate and mode == 'm':
+                # only update dirstate on branch merge, otherwise we
+                # could mark files with changes as unchanged
                 self.dirstate.update([f], mode)
 
         remove.sort()
--- a/tests/test-up-local-change.out
+++ b/tests/test-up-local-change.out
@@ -70,3 +70,9 @@ 1
 
 + hg diff
 + sed 's/\(\(---\|+++\).*\)\t.*/\1/'
+diff -r 1e71731e6fbb a
+--- a/a
++++ b/a
+@@ -1,1 +1,1 @@
+-a2
++abc