mercurial/commands.py
changeset 27010 f4fec0940278
parent 27004 a4c26918fb23
parent 26959 ed5f20f9c22e
child 27025 ec37257341a9
--- a/mercurial/commands.py	Sun Nov 01 14:43:25 2015 +0900
+++ b/mercurial/commands.py	Wed Nov 18 20:59:17 2015 -0600
@@ -5680,14 +5680,15 @@
                     ui.setconfig('ui', 'forcemerge', '', 'resolve')
                     ms.commit()
 
-                # replace filemerge's .orig file with our resolve file
-                # for files in tocomplete, ms.resolve will not overwrite
-                # .orig -- only preresolve does
-                try:
-                    util.rename(a + ".resolve", cmdutil.origpath(ui, repo, a))
-                except OSError as inst:
-                    if inst.errno != errno.ENOENT:
-                        raise
+                # replace filemerge's .orig file with our resolve file, but only
+                # for merges that are complete
+                if complete:
+                    try:
+                        util.rename(a + ".resolve",
+                                    cmdutil.origpath(ui, repo, a))
+                    except OSError as inst:
+                        if inst.errno != errno.ENOENT:
+                            raise
 
         for f in tocomplete:
             try:
@@ -5701,6 +5702,10 @@
                 ui.setconfig('ui', 'forcemerge', '', 'resolve')
                 ms.commit()
 
+            # replace filemerge's .orig file with our resolve file
+            a = repo.wjoin(f)
+            util.rename(a + ".resolve", a + ".orig")
+
         ms.commit()
 
         if not didwork and pats: