2
from bzrlib import branch
5
b = branch.Branch.open(path)
8
rev_id = b.last_revision()
10
gcindex = r.revisions._index
11
return b, rev_key, gcindex
15
b = branch.Branch.open(path)
18
rev_id = b.last_revision()
20
bindex = r.revisions._index._graph_index._indices[0]
21
return b, rev_key, bindex
24
def ancestry_from_get_ancestry(path):
25
b, rev_key, bindex = get_bindex(path)
27
search_keys = set([rev_key])
32
missing_keys, search_keys = bindex.get_ancestry(search_keys, 0,
34
# print '%4d\t%5d\t%5d' % (generation, len(search_keys),
38
def ancestry_from_get_parent_map(path):
39
b, rev_key, gcindex = get_gcindex(path)
40
search_keys = set([rev_key])
44
next_parent_map = gcindex.get_parent_map(search_keys)
45
next_parent_keys = set()
46
map(next_parent_keys.update, next_parent_map.itervalues())
47
parent_map.update(next_parent_map)
48
next_parent_keys = next_parent_keys.difference(parent_map)
50
# print '%4d\t%5d\t%5d' % (generation, len(search_keys),
52
search_keys = next_parent_keys