/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-03-22 01:35:14 UTC
  • mfrom: (7490.7.6 work)
  • mto: This revision was merged to the branch mainline in revision 7499.
  • Revision ID: jelmer@jelmer.uk-20200322013514-7vw1ntwho04rcuj3
merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

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