27
27
def iter_anno_data(branch, file_id):
28
later_revision = branch.revno()
29
q = range(branch.revno())
28
max_revno = branch.revno()
29
later_revision = max_revno
31
later_text_sha1 = branch.basis_tree().inventory[file_id].text_sha1
33
next_tree = branch.working_tree()
34
later_text_sha1 = next_tree.get_file_sha1(file_id)
36
39
if file_id not in cur_tree.inventory:
39
text_sha1 = cur_tree.inventory[file_id].text_sha1
42
text_sha1 = cur_tree.get_file_sha1(file_id)
40
43
if text_sha1 != later_text_sha1:
41
patch = get_patch(branch, revno, later_revision, file_id)
42
yield revno+1, patch.iter_inserted(), patch
44
patch = get_patch(branch, cur_tree, next_tree, file_id)
46
if revno == max_revno:
49
display_id = str(revno+1)
50
yield display_id, patch.iter_inserted(), patch
43
51
later_revision = revno
44
52
later_text_sha1 = text_sha1
45
53
yield progress.Progress("revisions", i)
47
def get_patch(branch, old_revno, new_revno, file_id):
48
old_tree = branch.revision_tree(branch.get_rev_id(old_revno))
49
new_tree = branch.revision_tree(branch.get_rev_id(new_revno))
55
def get_patch(branch, old_tree, new_tree, file_id):
50
56
if file_id in old_tree.inventory:
51
57
old_file = old_tree.get_file(file_id).readlines()