configitems: register the 'merge.preferancestor' config
authorBoris Feld <boris.feld@octobus.net>
Fri, 30 Jun 2017 03:43:13 +0200
changeset 34479 99c3dee3f6ce
parent 34478 ef303daefdf7
child 34480 cbda631c1dde
configitems: register the 'merge.preferancestor' config
mercurial/configitems.py
mercurial/context.py
mercurial/merge.py
--- a/mercurial/configitems.py	Fri Jun 30 03:39:10 2017 +0200
+++ b/mercurial/configitems.py	Fri Jun 30 03:43:13 2017 +0200
@@ -302,6 +302,9 @@
 coreconfigitem('merge', 'followcopies',
     default=True,
 )
+coreconfigitem('merge', 'preferancestor',
+        default=lambda: ['*'],
+)
 coreconfigitem('pager', 'ignore',
     default=list,
 )
--- a/mercurial/context.py	Fri Jun 30 03:39:10 2017 +0200
+++ b/mercurial/context.py	Fri Jun 30 03:43:13 2017 +0200
@@ -659,7 +659,7 @@
             anc = cahs[0]
         else:
             # experimental config: merge.preferancestor
-            for r in self._repo.ui.configlist('merge', 'preferancestor', ['*']):
+            for r in self._repo.ui.configlist('merge', 'preferancestor'):
                 try:
                     ctx = changectx(self._repo, r)
                 except error.RepoLookupError:
--- a/mercurial/merge.py	Fri Jun 30 03:39:10 2017 +0200
+++ b/mercurial/merge.py	Fri Jun 30 03:43:13 2017 +0200
@@ -1566,7 +1566,7 @@
 
         p2 = repo[node]
         if pas[0] is None:
-            if repo.ui.configlist('merge', 'preferancestor', ['*']) == ['*']:
+            if repo.ui.configlist('merge', 'preferancestor') == ['*']:
                 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node())
                 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])]
             else: