--- a/mercurial/cmdutil.py Tue Jun 24 16:57:16 2014 +0100
+++ b/mercurial/cmdutil.py Tue Jun 24 17:27:18 2014 +0100
@@ -2408,7 +2408,6 @@
dsadded = set(changes[1])
dsremoved = set(changes[2])
dsadded |= _deletedadded
- dsmodified |= _deletedmodified
# only take into account for removes between wc and target
clean |= dsremoved - removed
@@ -2416,6 +2415,11 @@
# distinct between dirstate remove and other
removed -= dsremoved
+ # tell newly modified apart.
+ dsmodified &= modified
+ dsmodified |= modified & dsadded # dirstate added may needs backup
+ modified -= dsmodified
+
# if f is a rename, update `names` to also revert the source
cwd = repo.getcwd()
for f in dsadded:
@@ -2448,6 +2452,7 @@
# file state
# action
# make backup
+ (modified, (actions['revert'], False)),
(dsmodified, (actions['revert'], True)),
(missingmodified, (actions['remove'], True)),
(dsadded, (actions['revert'], True)),