Comments
Patch
@@ -2423,13 +2423,12 @@ def revert(ui, repo, ctx, parents, *pats
# split between files known in target manifest and the others
smf = set(mf)
# 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
#
# Even, when we revert agains something else than parent. this will
# slightly alter the behavior of revert (doing back up or not, delete
@@ -2539,10 +2538,12 @@ def revert(ui, repo, ctx, parents, *pats
# make backup
## 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
(dsadded, actions['remove'], discard),
# Removed since target, before working copy parent