Mercurial > public > mercurial-scm > hg
diff mercurial/cmdutil.py @ 28192:cb6a952efbf4 stable
revert: properly revert to ancestor of p2 during merge (issue5052)
During merge, added (from one perspective) file can be reported as "modified".
To work around that, revert was testing if modified file were present in the
parent manifest and marking them as "added" in this case. However, we should be
checking against the target revision manifest instead. Otherwise see file as
"newly added" even if they exist in the target revision.
That revert behavior regressed in 06fbd9518bc5.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 23 Feb 2016 11:41:47 +0100 |
parents | ce9696193175 |
children | 41dcd7545266 c407583cf5f6 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Mon Feb 01 12:36:28 2016 +0100 +++ b/mercurial/cmdutil.py Tue Feb 23 11:41:47 2016 +0100 @@ -2846,10 +2846,6 @@ mf = ctx.manifest() if node == p2: parent = p2 - if node == parent: - pmf = mf - else: - pmf = None # need all matching names in dirstate and manifest of target rev, # so have to walk both. do not print errors if files exist in one @@ -2964,11 +2960,7 @@ # in case of merge, files that are actually added can be reported as # modified, we need to post process the result if p2 != nullid: - if pmf is None: - # only need parent manifest in the merge case, - # so do not read by default - pmf = repo[parent].manifest() - mergeadd = dsmodified - set(pmf) + mergeadd = dsmodified - smf dsadded |= mergeadd dsmodified -= mergeadd