filemerge: use fctx.write() in the internal:dump tool, instead of copy
authorPhil Cohen <phillco@fb.com>
Tue, 05 Sep 2017 12:04:02 -0700
changeset 34076 cd38b83bfb23
parent 34075 a9d8caf95941
child 34077 26531db4647a
filemerge: use fctx.write() in the internal:dump tool, instead of copy This is slower but allows this tool to work with the "deferred writes" milestone of in-memory merge. The performance hit is not too noticiable since this only used for the :dump merge tool during a conflict. Differential Revision: https://phab.mercurial-scm.org/D617
mercurial/filemerge.py
--- a/mercurial/filemerge.py	Thu Aug 31 22:39:10 2017 -0700
+++ b/mercurial/filemerge.py	Tue Sep 05 12:04:02 2017 -0700
@@ -468,7 +468,7 @@
     a = _workingpath(repo, fcd)
     fd = fcd.path()
 
-    util.copyfile(a, a + ".local")
+    util.writefile(a + ".local", fcd.decodeddata())
     repo.wwrite(fd + ".other", fco.data(), fco.flags())
     repo.wwrite(fd + ".base", fca.data(), fca.flags())
     return False, 1, False