/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/git/annotate.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-01-30 16:50:07 UTC
  • mfrom: (7462.1.3 iter-bytes-as)
  • Revision ID: breezy.the.bot@gmail.com-20200130165007-5zvq5exazi9lmazn
Add VersionedFile.iter_bytes_as.

Merged from https://code.launchpad.net/~jelmer/brz/iter-bytes-as/+merge/378338

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        if storage_kind == 'fulltext':
63
63
            return self.store[self.blob_id].as_raw_string()
64
64
        elif storage_kind == 'lines':
 
65
            return list(osutils.chunks_to_lines(self.store[self.blob_id].as_raw_chunks()))
 
66
        elif storage_kind == 'chunked':
 
67
            return self.store[self.blob_id].as_raw_chunks()
 
68
        raise UnavailableRepresentation(self.key, storage_kind,
 
69
                                        self.storage_kind)
 
70
 
 
71
    def iter_bytes_as(self, storage_kind):
 
72
        if storage_kind == 'lines':
65
73
            return osutils.chunks_to_lines(self.store[self.blob_id].as_raw_chunks())
66
74
        elif storage_kind == 'chunked':
67
 
            return self.store[self.blob_id].as_raw_chunks()
 
75
            return iter(self.store[self.blob_id].as_raw_chunks())
68
76
        raise UnavailableRepresentation(self.key, storage_kind,
69
77
                                        self.storage_kind)
70
78
 
93
101
    def get_bytes_as(self, storage_kind):
94
102
        raise ValueError
95
103
 
 
104
    def iter_bytes_as(self, storage_kind):
 
105
        raise ValueError
 
106
 
96
107
 
97
108
class AnnotateProvider(object):
98
109