diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -266,12 +266,17 @@ class dirstate(object): self._pl = p1, p2 copies = {} if oldp2 != nullid and p2 == nullid: - # Discard 'm' markers when moving away from a merge state for f, s in self._map.iteritems(): + # Discard 'm' markers when moving away from a merge state if s[0] == 'm': if f in self._copymap: copies[f] = self._copymap[f] self.normallookup(f) + # Also fix up otherparent markers + elif s[0] == 'n' and s[2] == -2: + if f in self._copymap: + copies[f] = self._copymap[f] + self.add(f) return copies def setbranch(self, branch): diff --git a/tests/test-histedit-no-change.t b/tests/test-histedit-no-change.t --- a/tests/test-histedit-no-change.t +++ b/tests/test-histedit-no-change.t @@ -181,7 +181,7 @@ abort editing session, after first forci parent: 0:cb9a9f314b8b a branch: default - commit: 1 modified, 1 unknown (new branch head) + commit: 1 added, 1 unknown (new branch head) update: 6 new changesets (update) hist: 2 remaining (histedit --continue) @@ -190,7 +190,7 @@ abort editing session, after first forci modified files should survive the abort when we've moved away already $ hg st - M e + A e ? edit.sh $ graphlog "log after abort" diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t --- a/tests/test-rebase-collapse.t +++ b/tests/test-rebase-collapse.t @@ -71,9 +71,9 @@ Rebasing B onto H and collapsing changes HG: -- HG: user: Nicolas Dumazet HG: branch 'default' - HG: changed B - HG: changed C - HG: changed D + HG: added B + HG: added C + HG: added D ==== saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t --- a/tests/test-rebase-scenario-global.t +++ b/tests/test-rebase-scenario-global.t @@ -59,7 +59,7 @@ D onto H - simple rebase: HG: -- HG: user: Nicolas Dumazet HG: branch 'default' - HG: changed D + HG: added D saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) $ hg tglog