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.
--- 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