phillco updated this revision to Diff 4713.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1815?vs=4711&id=4713

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -1556,11 +1556,9 @@
     usemergedriver = not overwrite and mergeactions and ms.mergedriver
 
     if usemergedriver:
-        if wctx.isinmemory():
-            raise error.InMemoryMergeConflictsError("in-memory merge does not "
-                                                    "support mergedriver")
         ms.commit()
         proceed = driverpreprocess(repo, ms, wctx, labels=labels)
+        drivverresolved = [f for f in ms.driverresolved()]
 
         # Note which files were marked as driver-resolved but not matched by
         # experimental.inmemorydisallowedpaths. This will allow us to keep
@@ -1573,9 +1571,18 @@
         if not pathsconfig:
             pathsconfig = ".^"
         regex = util.re.compile(pathsconfig)
-        unmatched = [f for f in ms.driverresolved() if not regex.match(f)]
+        unmatched = [f for f in drivverresolved if not regex.match(f)]
         repo.ui.log('imm_mergedriver', '',
-            driver_resolved_missed="|".join(sorted(unmatched)))
+            driver_resolved_missed="|".join(sorted(unmatched)),
+            in_memory=wctx.isinmemory())
+
+        # If preprocess() marked any files as driver-resolved and we're merging
+        # in-memory, abort on the assumption that driver scripts require the
+        # working directory.
+        if drivverresolved and wctx.isinmemory():
+            errorstr = ("some of your files require mergedriver to run, which "
+                       "in-memory merge does not support")
+            raise error.InMemoryMergeConflictsError(errorstr)
 
         # the driver might leave some files unresolved
         unresolvedf = set(ms.unresolved())



To: phillco, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to