# HG changeset patch # User Idan Kamara # Date 1302887264 -10800 # Node ID e44ebd2a142aa6920b33fc9f21c20e2516424cbd # Parent f4e4faa92939d213543ad85fa650ad54bc2b4f04 revset: optimize stringset when subset == entire repo if range(len(repo)) is passed to stringset and x is a valid rev (checked before) then x is guaranteed to be in subset, we can check for that by comparing the lengths of the sets diff -r f4e4faa92939 -r e44ebd2a142a mercurial/revset.py --- a/mercurial/revset.py Thu Apr 14 10:00:15 2011 +0200 +++ b/mercurial/revset.py Fri Apr 15 20:07:44 2011 +0300 @@ -123,7 +123,7 @@ x = repo[x].rev() if x == -1 and len(subset) == len(repo): return [-1] - if x in subset: + if len(subset) == len(repo) or x in subset: return [x] return []