comparison mercurial/obsutil.py @ 40513:c7618901584d

obsutil: prefetch method in allpredecessors loop We don't expect a massive speedup from this, but the change was laying around in my repository and it cannot hurt.
author Boris Feld <boris.feld@octobus.net>
date Fri, 19 Oct 2018 00:53:18 +0200
parents bae6f1418a95
children 520514af2d93
comparison
equal deleted inserted replaced
40512:4fe63b573791 40513:c7618901584d
146 This is a linear yield unsuited to detecting folded changesets. It includes 146 This is a linear yield unsuited to detecting folded changesets. It includes
147 initial nodes too.""" 147 initial nodes too."""
148 148
149 remaining = set(nodes) 149 remaining = set(nodes)
150 seen = set(remaining) 150 seen = set(remaining)
151 prec = obsstore.predecessors.get
151 while remaining: 152 while remaining:
152 current = remaining.pop() 153 current = remaining.pop()
153 yield current 154 yield current
154 for mark in obsstore.predecessors.get(current, ()): 155 for mark in prec(current, ()):
155 # ignore marker flagged with specified flag 156 # ignore marker flagged with specified flag
156 if mark[2] & ignoreflags: 157 if mark[2] & ignoreflags:
157 continue 158 continue
158 suc = mark[0] 159 suc = mark[0]
159 if suc not in seen: 160 if suc not in seen: