revert: use "remove" information from both statuses
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 24 Jun 2014 16:53:22 +0100
changeset 22188 0ad619c5e1a4
parent 22187 aee5385e4bae
child 22189 cde6b489365c
revert: use "remove" information from both statuses Using status information against the target to make sure we are catching all files that need to be re-added. We still need to distinguish fresh removal because they use a different message.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Fri Aug 01 18:27:47 2014 -0700
+++ b/mercurial/cmdutil.py	Tue Jun 24 16:53:22 2014 +0100
@@ -2410,6 +2410,12 @@
             dsadded |= _deletedadded
             dsmodified |= _deletedmodified
 
+            # only take into account for removes between wc and target
+            clean |= dsremoved - removed
+            dsremoved &= removed
+            # distinct between dirstate remove and other
+            removed -= dsremoved
+
         # if f is a rename, update `names` to also revert the source
         cwd = repo.getcwd()
         for f in dsadded:
@@ -2429,8 +2435,6 @@
         dsmodified -= missingmodified
         missingadded = dsadded - smf
         dsadded -= missingadded
-        clean |= dsremoved - smf
-        dsremoved -= clean
 
         # action to be actually performed by revert
         # (<list of file>, message>) tuple
@@ -2448,6 +2452,7 @@
             (missingmodified,  (actions['remove'],   True)),
             (dsadded,          (actions['revert'],   True)),
             (missingadded,     (actions['remove'],   False)),
+            (removed,          (actions['add'],      True)),
             (dsremoved,        (actions['undelete'], True)),
             (clean,            (None,                False)),
             )