# HG changeset patch # User Martin von Zweigbergk # Date 1466710745 25200 # Node ID c2193e59ef9f0435a62ee2cc3c5cb8d260dfe1a2 # Parent fbe380dc227a0240939aa5a4941eda70d958ea40 revsets: passing a set to baseset() is not wrong Since 69c6e9623bdc (revset: force ascending order for baseset initialized from a set, 2016-04-04), it is safe to pass a revset to a baseset. diff -r fbe380dc227a -r c2193e59ef9f mercurial/revset.py --- a/mercurial/revset.py Fri Jun 24 02:04:43 2016 +0200 +++ b/mercurial/revset.py Thu Jun 23 12:39:05 2016 -0700 @@ -692,20 +692,18 @@ return subset.filter(matches, condrepr=('', field, pat)) -def _children(repo, narrow, parentset): +def _children(repo, subset, parentset): if not parentset: return baseset() cs = set() pr = repo.changelog.parentrevs minrev = parentset.min() - for r in narrow: + for r in subset: if r <= minrev: continue for p in pr(r): if p in parentset: cs.add(r) - # XXX using a set to feed the baseset is wrong. Sets are not ordered. - # This does not break because of other fullreposet misbehavior. return baseset(cs) @predicate('children(set)', safe=True) @@ -1149,8 +1147,6 @@ cl = repo.changelog for b, ls in repo.branchmap().iteritems(): hs.update(cl.rev(h) for h in ls) - # XXX using a set to feed the baseset is wrong. Sets are not ordered. - # This does not break because of other fullreposet misbehavior. # XXX We should combine with subset first: 'subset & baseset(...)'. This is # necessary to ensure we preserve the order in subset. return baseset(hs) & subset