# HG changeset patch # User Bryan O'Sullivan # Date 2012-04-19 04:27:35 # Node ID 7f59900e3f8bd99877ca150bbd0cfc2d0c2e32b4 # Parent c53a49c345e15f5caf3b29bc8b32daeed4b06665 revset: fix O(n**2) behaviour of bisect() (issue3381) diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -291,7 +291,8 @@ def bisect(repo, subset, x): - ``ignored`` : csets ignored due to DAG topology """ status = getstring(x, _("bisect requires a string")).lower() - return [r for r in subset if r in hbisect.get(repo, status)] + state = set(hbisect.get(repo, status)) + return [r for r in subset if r in state] # Backward-compatibility # - no help entry so that we do not advertise it any more