mercurial/cmdutil.py
changeset 25759 ff11c1565c04
parent 25758 c5dfa47ad7ee
child 25762 f4412380d357
--- a/mercurial/cmdutil.py	Wed Jul 08 17:01:09 2015 +0900
+++ b/mercurial/cmdutil.py	Wed Jul 08 17:07:45 2015 +0900
@@ -203,8 +203,16 @@
         finally:
             # 5. finally restore backed-up files
             try:
+                dirstate = repo.dirstate
                 for realname, tmpname in backups.iteritems():
                     ui.debug('restoring %r to %r\n' % (tmpname, realname))
+
+                    if dirstate[realname] == 'n':
+                        # without normallookup, restoring timestamp
+                        # may cause partially committed files
+                        # to be treated as unmodified
+                        dirstate.normallookup(realname)
+
                     util.copyfile(tmpname, repo.wjoin(realname))
                     # Our calls to copystat() here and above are a
                     # hack to trick any editors that have f open that