dirstate: properly clean-up some more merge state on setparents

This commit is contained in:
Matt Mackall 2014-10-10 13:05:50 -05:00
parent 030db2699f
commit a44416ab0f
4 changed files with 12 additions and 7 deletions

View File

@ -266,12 +266,17 @@ class dirstate(object):
self._pl = p1, p2 self._pl = p1, p2
copies = {} copies = {}
if oldp2 != nullid and p2 == nullid: if oldp2 != nullid and p2 == nullid:
# Discard 'm' markers when moving away from a merge state
for f, s in self._map.iteritems(): for f, s in self._map.iteritems():
# Discard 'm' markers when moving away from a merge state
if s[0] == 'm': if s[0] == 'm':
if f in self._copymap: if f in self._copymap:
copies[f] = self._copymap[f] copies[f] = self._copymap[f]
self.normallookup(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 return copies
def setbranch(self, branch): def setbranch(self, branch):

View File

@ -181,7 +181,7 @@ abort editing session, after first forcibly updating away
parent: 0:cb9a9f314b8b parent: 0:cb9a9f314b8b
a a
branch: default branch: default
commit: 1 modified, 1 unknown (new branch head) commit: 1 added, 1 unknown (new branch head)
update: 6 new changesets (update) update: 6 new changesets (update)
hist: 2 remaining (histedit --continue) hist: 2 remaining (histedit --continue)
@ -190,7 +190,7 @@ abort editing session, after first forcibly updating away
modified files should survive the abort when we've moved away already modified files should survive the abort when we've moved away already
$ hg st $ hg st
M e A e
? edit.sh ? edit.sh
$ graphlog "log after abort" $ graphlog "log after abort"

View File

@ -71,9 +71,9 @@ Rebasing B onto H and collapsing changesets with different phases:
HG: -- HG: --
HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com> HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
HG: branch 'default' HG: branch 'default'
HG: changed B HG: added B
HG: changed C HG: added C
HG: changed D HG: added D
==== ====
saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)

View File

@ -59,7 +59,7 @@ D onto H - simple rebase:
HG: -- HG: --
HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com> HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
HG: branch 'default' HG: branch 'default'
HG: changed D HG: added D
saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
$ hg tglog $ hg tglog