/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/bzr/groupcompress.py

  • Committer: Jelmer Vernooij
  • Date: 2020-05-24 00:42:36 UTC
  • mto: This revision was merged to the branch mainline in revision 7505.
  • Revision ID: jelmer@jelmer.uk-20200524004236-jdj6obo4k5lznqw2
Cleanup Windows functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    adapter_registry,
50
50
    AbsentContentFactory,
51
51
    ChunkedContentFactory,
52
 
    ExistingContent,
53
52
    FulltextContentFactory,
54
53
    VersionedFilesWithFallbacks,
55
 
    UnavailableRepresentation,
56
54
    )
57
55
 
58
56
# Minimum number of uncompressed bytes to try fetch at once when retrieving
484
482
                return self._chunks
485
483
            else:
486
484
                return osutils.chunks_to_lines(self._chunks)
487
 
        raise UnavailableRepresentation(self.key, storage_kind,
 
485
        raise errors.UnavailableRepresentation(self.key, storage_kind,
488
486
                                               self.storage_kind)
489
487
 
490
488
    def iter_bytes_as(self, storage_kind):
494
492
            return iter(self._chunks)
495
493
        elif storage_kind == 'lines':
496
494
            return iter(osutils.chunks_to_lines(self._chunks))
497
 
        raise UnavailableRepresentation(self.key, storage_kind,
 
495
        raise errors.UnavailableRepresentation(self.key, storage_kind,
498
496
                                               self.storage_kind)
499
497
 
500
498
 
865
863
        """
866
864
        if length == 0:  # empty, like a dir entry, etc
867
865
            if nostore_sha == _null_sha1:
868
 
                raise ExistingContent()
 
866
                raise errors.ExistingContent()
869
867
            return _null_sha1, 0, 0, 'fulltext'
870
868
        # we assume someone knew what they were doing when they passed it in
871
869
        if expected_sha is not None:
874
872
            sha1 = osutils.sha_strings(chunks)
875
873
        if nostore_sha is not None:
876
874
            if sha1 == nostore_sha:
877
 
                raise ExistingContent()
 
875
                raise errors.ExistingContent()
878
876
        if key[-1] is None:
879
877
            key = key[:-1] + (b'sha1:' + sha1,)
880
878
 
1835
1833
                    continue
1836
1834
            try:
1837
1835
                chunks = record.get_bytes_as('chunked')
1838
 
            except UnavailableRepresentation:
 
1836
            except errors.UnavailableRepresentation:
1839
1837
                adapter_key = record.storage_kind, 'chunked'
1840
1838
                adapter = get_adapter(adapter_key)
1841
1839
                chunks = adapter.get_bytes(record, 'chunked')