changeset 35703:9a50ffd15b25

filemerge: only write in-memory backup during premerge This wasn't broken, but should mirror the non-in memory case to save an extra write. Differential Revision: https://phab.mercurial-scm.org/D1807
author Phil Cohen <phillco@fb.com>
date Thu, 04 Jan 2018 21:37:03 -0800
parents c0439e11af16
children 41ef02ba329b
files mercurial/filemerge.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filemerge.py	Thu Jan 04 21:36:58 2018 -0800
+++ b/mercurial/filemerge.py	Thu Jan 04 21:37:03 2018 -0800
@@ -636,7 +636,8 @@
         # merging in-memory, we must redirect the backup to the memory context
         # so we don't disturb the working directory.
         relpath = back[len(repo.wvfs.base) + 1:]
-        wctx[relpath].write(fcd.data(), fcd.flags())
+        if premerge:
+            wctx[relpath].write(fcd.data(), fcd.flags())
         return wctx[relpath]
     else:
         if premerge: