~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weavefile.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-04 15:29:17 UTC
  • mfrom: (2961 +trunk)
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071104152917-nrsumxpk3dikso2c
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
    for l in weave._weave:
74
74
        if isinstance(l, tuple):
 
75
            assert l[0] in '{}[]'
75
76
            if l[0] == '}':
76
77
                f.write('}\n')
77
78
            else:
80
81
            if not l:
81
82
                f.write(', \n')
82
83
            elif l[-1] == '\n':
 
84
                assert l.find('\n', 0, -1) == -1
83
85
                f.write('. ' + l)
84
86
            else:
 
87
                assert l.find('\n') == -1
85
88
                f.write(', ' + l + '\n')
86
89
 
87
90
    f.write('W\n')
137
140
                w._parents.append(map(int, l[2:].split(' ')))
138
141
            else:
139
142
                w._parents.append([])
 
143
 
140
144
            l = lines.next()[:-1]
 
145
            assert '1 ' == l[0:2]
141
146
            w._sha1s.append(l[2:])
 
147
                
142
148
            l = lines.next()
 
149
            assert 'n ' == l[0:2]
143
150
            name = l[2:-1]
 
151
            assert name not in w._name_map
144
152
            w._names.append(name)
145
153
            w._name_map[name] = ver
 
154
                
146
155
            l = lines.next()
 
156
            assert l == '\n'
 
157
 
147
158
            ver += 1
148
159
        elif l == 'w\n':
149
160
            break
162
173
        elif l == '}\n':
163
174
            w._weave.append(('}', None))
164
175
        else:
 
176
            assert l[0] in '{[]', l
 
177
            assert l[1] == ' ', l
165
178
            w._weave.append((intern(l[0]), int(l[2:])))
 
179
 
166
180
    return w
 
181