revert: process removed files missing in target as clean
authorPierre-Yves David <pierre-yves.david@fb.com>
Fri, 01 Aug 2014 18:27:47 -0700
changeset 22187 aee5385e4bae
parent 22186 a89bc7833e0d
child 22188 0ad619c5e1a4
revert: process removed files missing in target as clean If a file does not exist in target and is marked as removed in the dirstate, we can mark it as clean. There are no changes needed to revert it.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Thu Jul 31 15:52:56 2014 -0700
+++ b/mercurial/cmdutil.py	Fri Aug 01 18:27:47 2014 -0700
@@ -2429,8 +2429,8 @@
         dsmodified -= missingmodified
         missingadded = dsadded - smf
         dsadded -= missingadded
-        missingremoved = dsremoved - smf
-        dsremoved -= missingremoved
+        clean |= dsremoved - smf
+        dsremoved -= clean
 
         # action to be actually performed by revert
         # (<list of file>, message>) tuple
@@ -2449,7 +2449,6 @@
             (dsadded,          (actions['revert'],   True)),
             (missingadded,     (actions['remove'],   False)),
             (dsremoved,        (actions['undelete'], True)),
-            (missingremoved,   (None,                False)),
             (clean,            (None,                False)),
             )