~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weavefile.py

  • Committer: Martin Pool
  • Date: 2006-03-10 06:29:53 UTC
  • mfrom: (1608 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060310062953-bc1c7ade75c89a7a
[merge] bzr.dev; pycurl not updated for readv yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
 
93
93
 
94
94
 
95
 
def read_weave(f,prelude=False):
96
 
    return read_weave_v5(f,prelude=prelude)
97
 
 
98
 
 
99
 
def read_weave_v5(f,prelude=False):
100
 
    from weave import Weave, WeaveFormatError
 
95
def read_weave(f):
 
96
    # FIXME: detect the weave type and dispatch
 
97
    from bzrlib.trace import mutter
 
98
    from weave import Weave
101
99
    w = Weave(getattr(f, 'name', None))
 
100
    _read_weave_v5(f, w)
 
101
    return w
 
102
 
 
103
 
 
104
def _read_weave_v5(f, w):
 
105
    """Private helper routine to read a weave format 5 file into memory.
 
106
    
 
107
    This is only to be used by read_weave and WeaveFile.__init__.
 
108
    """
 
109
    from weave import WeaveFormatError
102
110
 
103
111
    l = f.readline()
104
112
    if l != FORMAT_1:
133
141
        else:
134
142
            raise WeaveFormatError('unexpected line %r' % l)
135
143
 
136
 
    if prelude:
137
 
        return w
138
 
 
139
144
    while True:
140
145
        l = f.readline()
141
146
        if l == 'W\n':