Mercurial > hg
changeset 11650:ebaf117c2642 stable
revset: fix ancestor subset handling (issue2298)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 22 Jul 2010 08:17:38 -0500 |
parents | 48163c39e1f1 |
children | 817258259bc9 5ed6802e6bcb |
files | mercurial/revset.py tests/test-revset tests/test-revset.out |
diffstat | 3 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revset.py Mon Jul 12 16:07:58 2010 +0200 +++ b/mercurial/revset.py Thu Jul 22 08:17:38 2010 -0500 @@ -223,11 +223,14 @@ def ancestor(repo, subset, x): l = getargs(x, 2, 2, _("ancestor wants two arguments")) - a = getset(repo, subset, l[0]) - b = getset(repo, subset, l[1]) - if len(a) > 1 or len(b) > 1: + r = range(len(repo)) + a = getset(repo, r, l[0]) + b = getset(repo, r, l[1]) + if len(a) != 1 or len(b) != 1: raise error.ParseError(_("ancestor arguments must be single revisions")) - return [repo[a[0]].ancestor(repo[b[0]]).rev()] + an = [repo[a[0]].ancestor(repo[b[0]]).rev()] + + return [r for r in an if r in subset] def ancestors(repo, subset, x): args = getset(repo, range(len(repo)), x)