mercurial/dirstate.py
changeset 22896 7e9cbb9c6053
parent 22895 dfa44e25bb53
child 22897 8fe74328f700
--- a/mercurial/dirstate.py	Fri Oct 10 13:05:50 2014 -0500
+++ b/mercurial/dirstate.py	Fri Oct 10 13:31:06 2014 -0500
@@ -415,7 +415,13 @@
         if self._pl[1] == nullid:
             raise util.Abort(_("setting %r to other parent "
                                "only allowed in merges") % f)
-        self._addpath(f, 'n', 0, -2, -1)
+        if f in self and self[f] == 'n':
+            # merge-like
+            self._addpath(f, 'm', 0, -2, -1)
+        else:
+            # add-like
+            self._addpath(f, 'n', 0, -2, -1)
+
         if f in self._copymap:
             del self._copymap[f]