filemerge: only copy to backup during premerge step
authorSiddharth Agarwal <sid0@fb.com>
Sun, 11 Oct 2015 20:04:40 -0700
changeset 26610 f9f82c444ff7
parent 26609 47681e77e484
child 26611 a5ff66e6d77a
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.
mercurial/filemerge.py
--- 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