/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 breezy/knit.py

  • Committer: Breezy landing bot
  • Author(s): Martin
  • Date: 2017-05-24 23:39:17 UTC
  • mfrom: (6631.2.3 i_unzipping)
  • Revision ID: breezy.the.bot@gmail.com-20170524233917-mueb4wxk2hr0n0fg
Make use of zip Python 3 compatible

Merged from https://code.launchpad.net/~gz/brz/i_unzipping/+merge/324552

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
from __future__ import absolute_import
55
55
 
56
 
 
57
 
from itertools import izip
58
56
import operator
59
57
import os
60
58
 
471
469
 
472
470
    def __init__(self, lines):
473
471
        KnitContent.__init__(self)
474
 
        self._lines = lines
 
472
        self._lines = list(lines)
475
473
 
476
474
    def annotate(self):
477
475
        """Return a list of (origin, text) for each content line."""
504
502
        return lines
505
503
 
506
504
    def copy(self):
507
 
        return AnnotatedKnitContent(self._lines[:])
 
505
        return AnnotatedKnitContent(self._lines)
508
506
 
509
507
 
510
508
class PlainKnitContent(KnitContent):
599
597
        #       but the code itself doesn't really depend on that.
600
598
        #       Figure out a way to not require the overhead of turning the
601
599
        #       list back into tuples.
602
 
        lines = [tuple(line.split(' ', 1)) for line in content]
 
600
        lines = (tuple(line.split(' ', 1)) for line in content)
603
601
        return AnnotatedKnitContent(lines)
604
602
 
605
603
    def parse_line_delta_iter(self, lines):
1933
1931
        raw_data = self._access.get_raw_records(
1934
1932
            [index_memo for key, index_memo in needed_records])
1935
1933
 
1936
 
        for (key, index_memo), data in \
1937
 
                izip(iter(needed_records), raw_data):
 
1934
        for (key, index_memo), data in zip(needed_records, raw_data):
1938
1935
            content, digest = self._parse_record(key[-1], data)
1939
1936
            yield key, content, digest
1940
1937