/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: John Arbash Meinel
  • Date: 2006-12-06 20:30:55 UTC
  • mto: (2163.1.5 fileids_altered_merged)
  • mto: This revision was merged to the branch mainline in revision 2165.
  • Revision ID: john@arbash-meinel.com-20061206203055-sxf30mwnwdl0wbi9
Don't modify the list during parse_line_delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
        return KnitContent(lines)
176
176
 
177
177
    def parse_line_delta_iter(self, lines):
178
 
        for result_item in self.parse_line_delta[lines]:
179
 
            yield result_item
 
178
        return iter(self.parse_line_delta(lines))
180
179
 
181
180
    def parse_line_delta(self, lines, version):
182
181
        """Convert a line based delta into internal representation.
240
239
        return self.make(content, version)
241
240
 
242
241
    def parse_line_delta_iter(self, lines, version):
243
 
        while lines:
244
 
            header = lines.pop(0)
 
242
        cur = 0
 
243
        num_lines = len(lines)
 
244
        while cur < num_lines:
 
245
            header = lines[cur]
 
246
            cur += 1
245
247
            start, end, c = [int(n) for n in header.split(',')]
246
 
            yield start, end, c, zip([version] * c, lines[:c])
247
 
            del lines[:c]
 
248
            yield start, end, c, zip([version] * c, lines[cur:cur+c])
 
249
            cur += c
248
250
 
249
251
    def parse_line_delta(self, lines, version):
250
252
        return list(self.parse_line_delta_iter(lines, version))
251
 
    
 
253
 
252
254
    def lower_fulltext(self, content):
253
255
        return content.text()
254
256
 
794
796
                        assert content is None
795
797
                        content = self.factory.parse_fulltext(data, version_idx)
796
798
                    elif method == 'line-delta':
797
 
                        delta = self.factory.parse_line_delta(data[:], 
798
 
                                                              version_idx)
 
799
                        delta = self.factory.parse_line_delta(data, version_idx)
799
800
                        content = content.copy()
800
801
                        content._lines = self._apply_delta(content._lines, 
801
802
                                                           delta)