changeset 22397:1db04829bdc1

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 30 Aug 2014 02:09:53 +0200
parents c0213f2cb942
children 402e5fba6509
files mercurial/cmdutil.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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