changeset 22671:5220c12c43fd

changectx: skip all invalid merge.preferancestor values A better fix for 17011b36aac7 that will ignore other kinds of "invalid" revisions.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 01 Oct 2014 03:40:51 +0200
parents 44dce874de97
children 19903277f035
files mercurial/context.py tests/test-merge-criss-cross.t
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Wed Apr 30 16:56:23 2014 -0700
+++ b/mercurial/context.py	Wed Oct 01 03:40:51 2014 +0200
@@ -558,9 +558,10 @@
             anc = cahs[0]
         else:
             for r in self._repo.ui.configlist('merge', 'preferancestor'):
-                if r == '*':
+                try:
+                    ctx = changectx(self._repo, r)
+                except error.RepoLookupError:
                     continue
-                ctx = changectx(self._repo, r)
                 anc = ctx.node()
                 if anc in cahs:
                     break
--- a/tests/test-merge-criss-cross.t	Wed Apr 30 16:56:23 2014 -0700
+++ b/tests/test-merge-criss-cross.t	Wed Oct 01 03:40:51 2014 +0200
@@ -349,7 +349,7 @@
   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
+  $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
+  2
 
   $ cd ..