D627: filemerge: flush if using deferred writes when running a merge tool

phillco (Phil Cohen) phabricator at mercurial-scm.org
Tue Sep 5 01:42:17 UTC 2017


phillco created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Since merge tools might read from the filesystem, we need to write out our
  deferred writes here.
  
  No-ops if not using deferred writes.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/filemerge.py

CHANGE DETAILS

diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py
--- a/mercurial/filemerge.py
+++ b/mercurial/filemerge.py
@@ -496,6 +496,12 @@
         repo.ui.warn(_('warning: %s cannot merge change/delete conflict '
                        'for %s\n') % (tool, fcd.path()))
         return False, 1, None
+
+    # Must flush any deferred contents if running a merge tool.
+    from . import context
+    if isinstance(wctx, context.overlayworkingctx):
+        wctx.flushall()
+
     unused, unused, unused, back = files
     a = _workingpath(repo, fcd)
     b, c = _maketempfiles(repo, fco, fca)



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


More information about the Mercurial-devel mailing list