Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revset.py @ 21893:e967c3b08705
revset: replace _missingancestors optimization with only revset
(::a - ::b) is equivalent to only(a, b).
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Sat, 12 Jul 2014 00:31:36 -0700 |
parents | dd716807fd23 |
children | 1000348b3aea |
line wrap: on
line diff
--- a/mercurial/revset.py Sat Jun 28 01:42:39 2014 +0200 +++ b/mercurial/revset.py Sat Jul 12 00:31:36 2014 -0700 @@ -1867,7 +1867,7 @@ wb, tb = optimize(x[2], True) # (::x and not ::y)/(not ::y and ::x) have a fast path - def ismissingancestors(revs, bases): + def isonly(revs, bases): return ( revs[0] == 'func' and getstring(revs[1], _('not a symbol')) == 'ancestors' @@ -1876,12 +1876,10 @@ and getstring(bases[1][1], _('not a symbol')) == 'ancestors') w = min(wa, wb) - if ismissingancestors(ta, tb): - return w, ('func', ('symbol', '_missingancestors'), - ('list', ta[2], tb[1][2])) - if ismissingancestors(tb, ta): - return w, ('func', ('symbol', '_missingancestors'), - ('list', tb[2], ta[1][2])) + if isonly(ta, tb): + return w, ('func', ('symbol', 'only'), ('list', ta[2], tb[1][2])) + if isonly(tb, ta): + return w, ('func', ('symbol', 'only'), ('list', tb[2], ta[1][2])) if wa > wb: return w, (op, tb, ta)