equal
deleted
inserted
replaced
32 |
32 |
33 if precnodeid in repo: |
33 if precnodeid in repo: |
34 yield precnodeid |
34 yield precnodeid |
35 else: |
35 else: |
36 stack.append(precnodeid) |
36 stack.append(precnodeid) |
|
37 |
|
38 def allprecursors(obsstore, nodes, ignoreflags=0): |
|
39 """Yield node for every precursors of <nodes>. |
|
40 |
|
41 Some precursors may be unknown locally. |
|
42 |
|
43 This is a linear yield unsuited to detecting folded changesets. It includes |
|
44 initial nodes too.""" |
|
45 |
|
46 remaining = set(nodes) |
|
47 seen = set(remaining) |
|
48 while remaining: |
|
49 current = remaining.pop() |
|
50 yield current |
|
51 for mark in obsstore.precursors.get(current, ()): |
|
52 # ignore marker flagged with specified flag |
|
53 if mark[2] & ignoreflags: |
|
54 continue |
|
55 suc = mark[0] |
|
56 if suc not in seen: |
|
57 seen.add(suc) |
|
58 remaining.add(suc) |
37 |
59 |
38 def _filterprunes(markers): |
60 def _filterprunes(markers): |
39 """return a set with no prune markers""" |
61 """return a set with no prune markers""" |
40 return set(m for m in markers if m[1]) |
62 return set(m for m in markers if m[1]) |
41 |
63 |