changeset 26610:f9f82c444ff7

filemerge: only copy to backup during premerge step The premerge might leave the original file in an unclean state. Therefore it's important to only copy the file in the beginning.
author Siddharth Agarwal <sid0@fb.com>
date Sun, 11 Oct 2015 20:04:40 -0700
parents 47681e77e484
children a5ff66e6d77a
files mercurial/filemerge.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filemerge.py	Sun Oct 11 20:02:53 2015 -0700
+++ b/mercurial/filemerge.py	Sun Oct 11 20:04:40 2015 -0700
@@ -505,7 +505,8 @@
     b = temp("base", fca)
     c = temp("other", fco)
     back = a + ".orig"
-    util.copyfile(a, back)
+    if premerge:
+        util.copyfile(a, back)
     files = (a, b, c, back)
 
     r = 1