Patchwork D1214: merge: don't check for unknown files in IMM

login
register
mail settings
Submitter phabricator
Date Dec. 7, 2017, 9:22 p.m.
Message ID <fe6420d8bcabaf7e3051545b65fc23ef@localhost.localdomain>
Download mbox | patch
Permalink /patch/26010/
State Not Applicable
Headers show

Comments

phabricator - Dec. 7, 2017, 9:22 p.m.
phillco updated this revision to Diff 4176.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1214?vs=3559&id=4176

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -646,6 +646,14 @@ 
     return config
 
 def _checkunknownfile(repo, wctx, mctx, f, f2=None):
+    if wctx.isinmemory():
+        # Nothing to do in IMM because nothing in the "working copy" can be an
+        # unknown file.
+        #
+        # Note that we should bail out here, not in ``_checkunknownfiles()``,
+        # because that function does other useful work.
+        return False
+
     if f2 is None:
         f2 = f
     return (repo.wvfs.audit.check(f)
@@ -674,7 +682,11 @@ 
         # updated with any new dirs that are checked and found to be absent.
         self._missingdircache = set()
 
-    def __call__(self, repo, f):
+    def __call__(self, repo, wctx, f):
+        if wctx.isinmemory():
+            # Nothing to do in IMM for the same reason as ``_checkunknownfile``.
+            return False
+
         # Check for path prefixes that exist as unknown files.
         for p in reversed(list(util.finddirs(f))):
             if p in self._missingdircache:
@@ -726,7 +738,7 @@ 
                 if _checkunknownfile(repo, wctx, mctx, f):
                     fileconflicts.add(f)
                 elif pathconfig and f not in wctx:
-                    path = checkunknowndirs(repo, f)
+                    path = checkunknowndirs(repo, wctx, f)
                     if path is not None:
                         pathconflicts.add(path)
             elif m == 'dg':