mercurial/cmdutil.py
branchstable
changeset 24843 21b33f0460e0
parent 24837 edf907bd8144
child 24845 8133494accf1
--- a/mercurial/cmdutil.py	Thu Apr 23 21:23:13 2015 +0200
+++ b/mercurial/cmdutil.py	Fri Apr 24 23:52:41 2015 +0900
@@ -3066,7 +3066,7 @@
     node = ctx.node()
     def checkout(f):
         fc = ctx[f]
-        repo.wwrite(f, fc.data(), fc.flags())
+        return repo.wwrite(f, fc.data(), fc.flags())
 
     audit_path = pathutil.pathauditor(repo.root)
     for f in actions['forget'][0]:
@@ -3114,9 +3114,13 @@
         del fp
     else:
         for f in actions['revert'][0]:
-            checkout(f)
+            wsize = checkout(f)
             if normal:
                 normal(f)
+            elif wsize == repo.dirstate._map[f][2]:
+                # changes may be overlooked without normallookup,
+                # if size isn't changed at reverting
+                repo.dirstate.normallookup(f)
 
     for f in actions['add'][0]:
         checkout(f)