Mercurial > hg-stable
changeset 25549:f93ff3ab8d14
revset: mark spots that should use 'smartset.min()'
Using smartset's min will be significantly faster when the input set can provided
an optimised answer. I do not have time to fix all of them but I'm marking the
spot.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 11 Jun 2015 14:26:44 -0700 |
parents | 9584bcf27637 |
children | 3e9049876ace |
files | mercurial/revset.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revset.py Thu Jun 11 14:21:21 2015 -0700 +++ b/mercurial/revset.py Thu Jun 11 14:26:44 2015 -0700 @@ -58,6 +58,8 @@ def iterate(): cl = repo.changelog + # XXX this should be 'parentset.min()' assuming 'parentset' is a + # smartset (and if it is not, it should.) first = min(revs) nullrev = node.nullrev if first == nullrev: @@ -85,6 +87,8 @@ visit = list(heads) reachable = set() seen = {} + # XXX this should be 'parentset.min()' assuming 'parentset' is a smartset + # (and if it is not, it should.) minroot = min(roots) roots = set(roots) # open-code the post-order traversal due to the tiny size of @@ -614,6 +618,8 @@ if not parentset: return baseset(cs) pr = repo.changelog.parentrevs + # XXX this should be 'parentset.min()' assuming 'parentset' is a smartset + # (and if it is not, it should.) minrev = min(parentset) for r in narrow: if r <= minrev: @@ -1217,6 +1223,8 @@ cl = repo.changelog if not subset: return baseset() + # XXX this should be 'parentset.min()' assuming 'parentset' is a smartset + # (and if it is not, it should.) baserev = min(subset) parentscount = [0]*(len(repo) - baserev) for r in cl.revs(start=baserev + 1):