Mercurial > hg-stable
changeset 22897:8fe74328f700
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.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 11 Oct 2014 14:05:09 -0500 |
parents | 7e9cbb9c6053 |
children | 43816070284e |
files | mercurial/dirstate.py tests/test-graft.t tests/test-merge-remove.t |
diffstat | 3 files changed, 7 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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'''
--- 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
--- 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