merge: add a config option to disable path conflict checking stable
authorSiddharth Agarwal <sid0@fb.com>
Tue, 24 Oct 2017 11:14:38 -0700
branchstable
changeset 34941 37450a122128
parent 34940 c2b30348930f
child 34942 2a774cae3a03
merge: add a config option to disable path conflict checking We've found a severe perf regression in `hg update` caused by the path conflict checking code. The next patch will disable this by default. Differential Revision: https://phab.mercurial-scm.org/D1222
mercurial/configitems.py
mercurial/merge.py
--- a/mercurial/configitems.py	Fri Oct 20 05:53:35 2017 -0700
+++ b/mercurial/configitems.py	Tue Oct 24 11:14:38 2017 -0700
@@ -578,6 +578,9 @@
 coreconfigitem('merge', 'checkignored',
     default='abort',
 )
+coreconfigitem('experimental', 'merge.checkpathconflicts',
+    default=True,
+)
 coreconfigitem('merge', 'followcopies',
     default=True,
 )
--- a/mercurial/merge.py	Fri Oct 20 05:53:35 2017 -0700
+++ b/mercurial/merge.py	Tue Oct 24 11:14:38 2017 -0700
@@ -693,6 +693,7 @@
     abortconflicts = set()
     unknownconfig = _getcheckunknownconfig(repo, 'merge', 'checkunknown')
     ignoredconfig = _getcheckunknownconfig(repo, 'merge', 'checkignored')
+    pathconfig = repo.ui.configbool('experimental', 'merge.checkpathconflicts')
     if not force:
         def collectconflicts(conflicts, config):
             if config == 'abort':
@@ -704,7 +705,7 @@
             if m in ('c', 'dc'):
                 if _checkunknownfile(repo, wctx, mctx, f):
                     fileconflicts.add(f)
-                elif f not in wctx:
+                elif pathconfig and f not in wctx:
                     path = _checkunknowndirs(repo, f)
                     if path is not None:
                         pathconflicts.add(path)
@@ -1139,8 +1140,9 @@
                     actions[f] = ('dc', (None, f, f, False, pa.node()),
                                   "prompt deleted/changed")
 
-    # If we are merging, look for path conflicts.
-    checkpathconflicts(repo, wctx, p2, actions)
+    if repo.ui.configbool('experimental', 'merge.checkpathconflicts'):
+        # If we are merging, look for path conflicts.
+        checkpathconflicts(repo, wctx, p2, actions)
 
     return actions, diverge, renamedelete