diff --git a/contrib/revsetbenchmarks.txt b/contrib/revsetbenchmarks.txt --- a/contrib/revsetbenchmarks.txt +++ b/contrib/revsetbenchmarks.txt @@ -23,4 +23,5 @@ draft() max(::(tip~20) - obsolete()) roots((0:tip)::) (not public() - obsolete()) +parents(20000) (20000::) - (20000) diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1236,7 +1236,7 @@ def parents(repo, subset, x): cl = repo.changelog for r in getset(repo, spanset(repo), x): ps.update(cl.parentrevs(r)) - return subset & ps + return baseset(ps) & subset def parentspec(repo, subset, x, n): """``set^0`` diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -567,10 +567,10 @@ test subtracting something from an addse test intersecting something with an addset $ log 'parents(outgoing() or removes(a))' + 8 1 4 5 - 8 check that conversion to only works $ try --optimize '::3 - ::1'