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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-06-30 12:37:04 UTC
  • mfrom: (6973.10.9 python3-i)
  • Revision ID: breezy.the.bot@gmail.com-20180630123704-jq2qazweqd3u5ssp
Add more bees.

Merged from https://code.launchpad.net/~jelmer/brz/python3-i/+merge/348244

Show diffs side-by-side

added added

removed removed

Lines of Context:
614
614
        if path is None:
615
615
            self.db = {}
616
616
        else:
617
 
            if type(path) is not str:
618
 
                raise TypeError(path)
619
617
            if path not in mapdbs():
620
618
                mapdbs()[path] = tdb.Tdb(path, self.TDB_HASH_SIZE, tdb.DEFAULT,
621
619
                                          os.O_RDWR|os.O_CREAT)
709
707
 
710
708
    def __getitem__(self, sha):
711
709
        stream = self._vf.get_record_stream([(sha,)], 'unordered', True)
712
 
        entry = stream.next() 
 
710
        entry = next(stream)
713
711
        if entry.storage_kind == 'absent':
714
712
            raise KeyError(sha)
715
713
        return ShaFile._parse_legacy_object(entry.get_bytes_as('fulltext'))
873
871
    def _get_entry(self, key):
874
872
        entries = self._index.iter_entries([key])
875
873
        try:
876
 
            return entries.next()[2]
 
874
            return next(entries)[2]
877
875
        except StopIteration:
878
876
            if self._builder is None:
879
877
                raise KeyError
880
878
            entries = self._builder.iter_entries([key])
881
879
            try:
882
 
                return entries.next()[2]
 
880
                return next(entries)[2]
883
881
            except StopIteration:
884
882
                raise KeyError
885
883