Patchwork D1807: filemerge: only write in-memory backup during premerge

login
register
mail settings
Submitter phabricator
Date Jan. 4, 2018, 7:36 p.m.
Message ID <differential-rev-PHID-DREV-tetl5zdkd532dk6omqo2-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26542/
State Superseded
Headers show

Comments

phabricator - Jan. 4, 2018, 7:36 p.m.
phillco created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This wasn't broken, but should mirror the non-in memory case to save an extra write.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1807

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS




To: phillco, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -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: