revert: track added files with local modifications
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 30 Aug 2014 02:39:08 +0200
changeset 22610 0f323ed8effd
parent 22609 3760ebf786b8
child 22611 2ff28e07d7d6
revert: track added files with local modifications Those files need to be backed up but are currently not. We compute the set of them to be able to use a different backup strategy in the next changeset.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sat Aug 30 02:30:24 2014 +0200
+++ b/mercurial/cmdutil.py	Sat Aug 30 02:39:08 2014 +0200
@@ -2524,6 +2524,7 @@
         unknown  = set(changes[4])
         unknown.update(changes[5])
         clean    = set(changes[6])
+        modadded = set()
 
         # split between files known in target manifest and the others
         smf = set(mf)
@@ -2554,6 +2555,9 @@
             # distinct between dirstate remove and other
             removed -= dsremoved
 
+            modadded = added & dsmodified
+            added -= modadded
+
             # tell newly modified apart.
             dsmodified &= modified
             dsmodified |= modified & dsadded # dirstate added may needs backup
@@ -2653,6 +2657,8 @@
             (added,         actions['remove'],   discard),
             # Added in working directory
             (dsadded,       actions['forget'],   discard),
+            # Added since target, have local modification
+            (modadded,      actions['remove'],   discard),
             # Added since target but file is missing in working directory
             (deladded,      actions['drop'],   discard),
             # Removed since  target, before working copy parent