Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 18739:5b7175377bab stable 2.5.2
setparents: drop copies from dropped p2 (issue3843)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 28 Feb 2013 21:29:31 -0600 |
parents | 751135cca13c |
children | 70e2a22fd66e 1c8e0d6ac3b0 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Feb 28 13:55:00 2013 +0100 +++ b/mercurial/localrepo.py Thu Feb 28 21:29:31 2013 -0600 @@ -705,14 +705,18 @@ def setparents(self, p1, p2=nullid): copies = self.dirstate.setparents(p1, p2) + pctx = self[p1] if copies: # Adjust copy records, the dirstate cannot do it, it # requires access to parents manifests. Preserve them # only for entries added to first parent. - pctx = self[p1] for f in copies: if f not in pctx and copies[f] in pctx: self.dirstate.copy(copies[f], f) + if p2 == nullid: + for f, s in sorted(self.dirstate.copies().items()): + if f not in pctx and s not in pctx: + self.dirstate.copy(None, f) def filectx(self, path, changeid=None, fileid=None): """changeid can be a changeset revision, node, or tag.