~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weavefile.py

  • Committer: Aaron Bentley
  • Date: 2005-09-19 01:19:59 UTC
  • mto: (1185.1.29)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: aaron.bentley@utoronto.ca-20050919011959-9cf31f97b991b08d
Switched NULL revision ID to 'null:' per robertc's suggestion

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/python
 
2
 
1
3
# Copyright (C) 2005 Canonical Ltd
2
4
 
3
5
# This program is free software; you can redistribute it and/or modify
92
94
 
93
95
 
94
96
 
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):
 
97
def read_weave(f):
 
98
    return read_weave_v5(f)
 
99
 
 
100
 
 
101
def read_weave_v5(f):
100
102
    from weave import Weave, WeaveFormatError
101
 
    w = Weave(getattr(f, 'name', None))
 
103
    w = Weave()
102
104
 
103
105
    l = f.readline()
104
106
    if l != FORMAT_1:
133
135
        else:
134
136
            raise WeaveFormatError('unexpected line %r' % l)
135
137
 
136
 
    if prelude:
137
 
        return w
138
 
 
139
138
    while True:
140
139
        l = f.readline()
141
140
        if l == 'W\n':