comparison mercurial/revset.py @ 32442:4dd292cec3ad

revset: add support for ancestors(wdir()) This is a part of extending support for wdir() predicate.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 23 May 2017 01:22:33 +0530
parents 018f638ad88e
children a3064fe3e495
comparison
equal deleted inserted replaced
32441:018f638ad88e 32442:4dd292cec3ad
73 if inputrev is not None: 73 if inputrev is not None:
74 heapq.heappush(h, -inputrev) 74 heapq.heappush(h, -inputrev)
75 if current not in seen: 75 if current not in seen:
76 seen.add(current) 76 seen.add(current)
77 yield current 77 yield current
78 for parent in cl.parentrevs(current)[:cut]: 78 try:
79 if parent != node.nullrev: 79 for parent in cl.parentrevs(current)[:cut]:
80 heapq.heappush(h, -parent) 80 if parent != node.nullrev:
81 heapq.heappush(h, -parent)
82 except error.WdirUnsupported:
83 for parent in repo[current].parents()[:cut]:
84 if parent.rev() != node.nullrev:
85 heapq.heappush(h, -parent.rev())
81 86
82 return generatorset(iterate(), iterasc=False) 87 return generatorset(iterate(), iterasc=False)
83 88
84 def _revdescendants(repo, revs, followfirst): 89 def _revdescendants(repo, revs, followfirst):
85 """Like revlog.descendants() but supports followfirst.""" 90 """Like revlog.descendants() but supports followfirst."""