~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to convertfile.py

  • Committer: Martin Pool
  • Date: 2005-06-30 10:00:57 UTC
  • mto: This revision was merged to the branch mainline in revision 852.
  • Revision ID: mbp@sourcefrog.net-20050630100057-32a93074b0f1faa8
doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import sys
23
23
import bzrlib.branch
24
 
from bzrlib.weave import Weave
25
 
from bzrlib.weavefile import write_weave
 
24
from weave import Weave
 
25
from weavefile import write_weave
26
26
 
27
27
import hotshot
28
28
import tempfile
33
33
 
34
34
    wf = Weave()
35
35
 
36
 
    toconvert = sys.argv[1]
37
 
    
38
 
    b = bzrlib.branch.find_branch(toconvert)
39
 
    rp = b.relpath(toconvert)
 
36
    b = bzrlib.branch.find_branch('.')
40
37
 
41
38
    print 'converting...'
42
39
 
43
 
    fid = b.read_working_inventory().path2id(rp)
 
40
    fid = b.read_working_inventory().path2id(sys.argv[1])
44
41
 
45
42
    last_lines = None
46
43
    parents = set()
62
59
        last_lines = text
63
60
        
64
61
        weave_id = wf.add(parents, text)
65
 
        parents = [weave_id]
 
62
        parents.add(weave_id)
66
63
 
67
64
        print '  %4d lines' % len(text)
68
65