comparison mercurial/revset.py @ 16394:f3df7d34791e stable

revset: do not ignore input revisions in roots() 0329d3b12d8e is also partially reverted to use the 'narrow' parameter again and make less changesets parents lookups.
author Patrick Mezard <patrick@mezard.eu>
date Sun, 08 Apr 2012 11:11:30 +0200
parents f06c53ca59a9
children c3fd35f88fbb
comparison
equal deleted inserted replaced
16372:709924be3d04 16394:f3df7d34791e
325 325
326 def _children(repo, narrow, s): 326 def _children(repo, narrow, s):
327 cs = set() 327 cs = set()
328 pr = repo.changelog.parentrevs 328 pr = repo.changelog.parentrevs
329 s = set(s) 329 s = set(s)
330 for r in xrange(len(repo)): 330 for r in narrow:
331 for p in pr(r): 331 for p in pr(r):
332 if p in s: 332 if p in s:
333 cs.add(r) 333 cs.add(r)
334 return cs 334 return cs
335 335
809 l.reverse() 809 l.reverse()
810 return l 810 return l
811 811
812 def roots(repo, subset, x): 812 def roots(repo, subset, x):
813 """``roots(set)`` 813 """``roots(set)``
814 Changesets with no parent changeset in set. 814 Changesets in set with no parent changeset in set.
815 """ 815 """
816 s = getset(repo, xrange(len(repo)), x) 816 s = set(getset(repo, xrange(len(repo)), x))
817 cs = _children(repo, s, s) 817 cs = _children(repo, subset, s)
818 return [r for r in s if r not in cs] 818 return [r for r in subset if r in s and r not in cs]
819 819
820 def secret(repo, subset, x): 820 def secret(repo, subset, x):
821 """``secret()`` 821 """``secret()``
822 Changeset in secret phase.""" 822 Changeset in secret phase."""
823 getargs(x, 0, 0, _("secret takes no arguments")) 823 getargs(x, 0, 0, _("secret takes no arguments"))