# HG changeset patch # User Siddharth Agarwal # Date 2017-10-24 18:14:38 # Node ID 37450a122128739ab499eb02b8568d44a5d3e3b3 # Parent c2b30348930fa431b1197b379cd2ff07c03a1060 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 diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -578,6 +578,9 @@ coreconfigitem('merge', 'checkunknown', coreconfigitem('merge', 'checkignored', default='abort', ) +coreconfigitem('experimental', 'merge.checkpathconflicts', + default=True, +) coreconfigitem('merge', 'followcopies', default=True, ) diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -693,6 +693,7 @@ def _checkunknownfiles(repo, wctx, mctx, 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 @@ def _checkunknownfiles(repo, wctx, mctx, 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 @@ def manifestmerge(repo, wctx, p2, pa, br 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