revert: distinguish between deleted file and locally modified
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 30 Aug 2014 02:09:53 +0200
changeset 22397 1db04829bdc1
parent 22396 c0213f2cb942
child 22398 402e5fba6509
revert: distinguish between deleted file and locally modified Locally modified needs a backup while a deleted file cannot be backed up because there is no file to backup.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sat Aug 30 02:00:20 2014 +0200
+++ b/mercurial/cmdutil.py	Sat Aug 30 02:09:53 2014 +0200
@@ -2425,9 +2425,8 @@
 
         # determine the exact nature of the deleted changesets
         _deletedadded = _deleted - smf
-        _deletedmodified = _deleted - _deletedadded
+        deleted = _deleted - _deletedadded
         added |= _deletedadded
-        modified |= _deletedmodified
 
         # We need to account for the state of file in the dirstate
         #
@@ -2541,6 +2540,8 @@
             ## Sets that results that will change file on disk
             # Modified compared to target, no local change
             (modified,      actions['revert'],   discard),
+            # Modified compared to target, but local file is deleted
+            (deleted,       actions['revert'],   discard),
             # Modified compared to target, local change
             (dsmodified,    actions['revert'],   backup),
             # Added since target