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

  • Committer: Jelmer Vernooij
  • Date: 2020-02-07 02:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200207021430-m49iq3x4x8xlib6x
Drop python2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    index as _mod_index,
42
42
    versionedfile,
43
43
    )
44
 
from ..sixish import (
45
 
    viewitems,
46
 
    viewkeys,
47
 
    viewvalues,
48
 
    )
49
44
from ..transport import (
50
45
    get_transport_from_path,
51
46
    )
336
331
    def lookup_git_sha(self, sha):
337
332
        if not isinstance(sha, bytes):
338
333
            raise TypeError(sha)
339
 
        for entry in viewvalues(self._by_sha[sha]):
 
334
        for entry in self._by_sha[sha].values():
340
335
            yield entry
341
336
 
342
337
    def lookup_tree_id(self, fileid, revision):
346
341
        return self._by_revid[revid]
347
342
 
348
343
    def revids(self):
349
 
        for key, entries in viewitems(self._by_sha):
350
 
            for (type, type_data) in viewvalues(entries):
 
344
        for key, entries in self._by_sha.items():
 
345
            for (type, type_data) in entries.values():
351
346
                if type == "commit":
352
347
                    yield type_data[0]
353
348
 
354
349
    def sha1s(self):
355
 
        return viewkeys(self._by_sha)
 
350
        return self._by_sha.keys()
356
351
 
357
352
 
358
353
class SqliteCacheUpdater(CacheUpdater):
711
706
        return ret
712
707
 
713
708
    def _keys(self):
714
 
        try:
715
 
            return self.db.keys()
716
 
        except AttributeError:  # python < 3
717
 
            return self.db.iterkeys()
 
709
        return self.db.keys()
718
710
 
719
711
    def revids(self):
720
712
        """List the revision ids known."""