changeset 22209:06fbd9518bc5

revert: detect files added during a merge In case of merge, file that are actually added can be reported as modified. This is currently handled by special-case code. We detect it beforehand instead. This will lets use remove the special-case code at some point in the future.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 24 Jun 2014 17:28:20 +0100
parents d3659b3795e9
children 537f55a27101
files mercurial/cmdutil.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Sat Aug 02 11:32:24 2014 -0700
+++ b/mercurial/cmdutil.py	Tue Jun 24 17:28:20 2014 +0100
@@ -2435,6 +2435,17 @@
             # So we just put them all in the same group.
             dsadded = added
 
+        # 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)
+            dsadded |= mergeadd
+            dsmodified -= mergeadd
+
         # if f is a rename, update `names` to also revert the source
         cwd = repo.getcwd()
         for f in dsadded: