# HG changeset patch # User Matt Mackall # Date 1413054309 18000 # Node ID 8fe74328f700907f8a9a9ad98ee5fff92864cf45 # Parent 7e9cbb9c6053ef7a2d16318213f9ce90039d1c6c dirstate: merge falls through to otherparent This lets us more correctly fix the state when we use setparents, as demonstrated in the change in test-graft.t. diff -r 7e9cbb9c6053 -r 8fe74328f700 mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Oct 10 13:31:06 2014 -0500 +++ b/mercurial/dirstate.py Sat Oct 11 14:05:09 2014 -0500 @@ -451,11 +451,7 @@ '''Mark a file merged.''' if self._pl[1] == nullid: return self.normallookup(f) - s = os.lstat(self._join(f)) - self._addpath(f, 'm', s.st_mode, - s.st_size & _rangemask, int(s.st_mtime) & _rangemask) - if f in self._copymap: - del self._copymap[f] + return self.otherparent(f) def drop(self, f): '''Drop a file from the dirstate''' diff -r 7e9cbb9c6053 -r 8fe74328f700 tests/test-graft.t --- a/tests/test-graft.t Fri Oct 10 13:31:06 2014 -0500 +++ b/tests/test-graft.t Sat Oct 11 14:05:09 2014 -0500 @@ -92,7 +92,7 @@ HG: -- HG: user: foo HG: branch 'default' - HG: changed b + HG: added b HG: removed a $ hg export tip --git # HG changeset patch diff -r 7e9cbb9c6053 -r 8fe74328f700 tests/test-merge-remove.t --- a/tests/test-merge-remove.t Fri Oct 10 13:31:06 2014 -0500 +++ b/tests/test-merge-remove.t Sat Oct 11 14:05:09 2014 -0500 @@ -22,7 +22,7 @@ $ hg debugstate --nodates m 0 -2 bar - m 644 14 foo1 + m 0 -2 foo1 copy: foo -> foo1 $ hg st -q @@ -55,8 +55,8 @@ adding foo1 $ hg debugstate --nodates - m 644 5 bar - m 644 14 foo1 + n 0 -2 bar + n 0 -2 foo1 copy: foo -> foo1 $ hg st -qC @@ -74,8 +74,8 @@ reverting foo1 $ hg debugstate --nodates - m 644 5 bar - m 644 14 foo1 + n 0 -2 bar + n 0 -2 foo1 copy: foo -> foo1 $ hg st -qC