Mercurial > hg
changeset 15373:9a2582e325a5 stable
revert: fix missing removes when parent was changed in dirstate
When dirstate parent is changed with dirstate.setparent before a
revert so it no longer points to where the dirstate refered to, revert
does not remove all files it should:
Revert to a different revision needs also to remove files that are not
found through disptables and not in the context or parent manifest.
author | Peer Stritzinger <peer@stritzinger.com> |
---|---|
date | Wed, 26 Oct 2011 18:47:12 +0200 |
parents | 695ac6aca77f |
children | 6cb8b46ea90a |
files | mercurial/commands.py |
diffstat | 1 files changed, 8 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Thu Oct 27 17:22:04 2011 -0500 +++ b/mercurial/commands.py Wed Oct 26 18:47:12 2011 +0200 @@ -4756,15 +4756,14 @@ # only need parent manifest in this unlikely case, # so do not read by default pmf = repo[parent].manifest() - if abs in pmf: - if mfentry: - # if version of file is same in parent and target - # manifests, do nothing - if (pmf[abs] != mfentry or - pmf.flags(abs) != mf.flags(abs)): - handle(revert, False) - else: - handle(remove, False) + if abs in pmf and mfentry: + # if version of file is same in parent and target + # manifests, do nothing + if (pmf[abs] != mfentry or + pmf.flags(abs) != mf.flags(abs)): + handle(revert, False) + else: + handle(remove, False) if not opts.get('dry_run'): def checkout(f):