# HG changeset patch # User Mads Kiilerich # Date 1408063604 -7200 # Node ID 17011b36aac77199ed0d9a8b6f4e331c767fc794 # Parent 46308fadaa15c1eec8b8873d8ebae89ccb97a7ec changectx: ancestor should only prefer merge.preferancestor if it is a revision The value '*' currently designates that bid merge should be used. The best way to test bid merge is to set preferancestor=* in the configuration file ... but then it would abort with unknown revision '*' when other code paths ended up in changectx.ancestor . Instead, just skip and ignore the value '*' when looking for a preferred ancestor. diff -r 46308fadaa15 -r 17011b36aac7 mercurial/context.py --- a/mercurial/context.py Fri Aug 15 02:39:01 2014 +0200 +++ b/mercurial/context.py Fri Aug 15 02:46:44 2014 +0200 @@ -553,6 +553,8 @@ anc = cahs[0] else: for r in self._repo.ui.configlist('merge', 'preferancestor'): + if r == '*': + continue ctx = changectx(self._repo, r) anc = ctx.node() if anc in cahs: diff -r 46308fadaa15 -r 17011b36aac7 tests/test-merge-criss-cross.t --- a/tests/test-merge-criss-cross.t Fri Aug 15 02:39:01 2014 +0200 +++ b/tests/test-merge-criss-cross.t Fri Aug 15 02:46:44 2014 +0200 @@ -341,4 +341,15 @@ b c +Verify that the old context ancestor works with / despite preferancestor: + + $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n' + 1 + $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n' + 2 + $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n' + 1 + $ hg log -r 'ancestor(head())' --config merge.preferancestor='*' -T '{rev}\n' + 1 + $ cd ..