~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to convertfile.py

  • Committer: Martin Pool
  • Date: 2005-06-30 09:38:14 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050630093814-59238a02b7fc34bc
Avoid re-encoding versions which have not changed
when converting from old bzr stores

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
 
40
40
    fid = b.read_working_inventory().path2id(sys.argv[1])
41
41
 
 
42
    last_lines = None
42
43
    parents = set()
43
 
    revno = 1
 
44
    revno = 0
44
45
    for rev_id in b.revision_history():
 
46
        revno += 1
45
47
        print revno
46
48
        tree = b.revision_tree(rev_id)
47
49
        inv = tree.inventory
51
53
            continue
52
54
 
53
55
        text = tree.get_file(fid).readlines()
 
56
 
 
57
        if text == last_lines:
 
58
            continue
 
59
        last_lines = text
 
60
        
54
61
        weave_id = wf.add(parents, text)
55
62
        parents.add(weave_id)
56
 
        revno += 1
57
63
 
58
64
        print '  %4d lines' % len(text)
59
65