branchpoint: remove useless intermediate set creation
We don't need to compute the set of all branchpoints. We can just check the
number of children that element of subset have. The extra work did not seems to
had particular performance impact but the code is simpler this way.
--- a/mercurial/revset.py Mon Oct 15 17:42:40 2012 +0200
+++ b/mercurial/revset.py Mon Oct 15 17:43:05 2012 +0200
@@ -933,9 +933,7 @@
for p in cl.parentrevs(r):
if p >= baserev:
parentscount[p - baserev] += 1
- branchpoints = set((baserev + i) for i in xrange(len(parentscount))
- if parentscount[i] > 1)
- return [r for r in subset if r in branchpoints]
+ return [r for r in subset if (parentscount[r - baserev] > 1)]
def minrev(repo, subset, x):
"""``min(set)``