/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-03 23:21:15 UTC
  • mfrom: (7290.42.6 paramiko-compat)
  • Revision ID: breezy.the.bot@gmail.com-20200203232115-g7k11bhsfeiqcprv
Fix compatibility with newer versions of paramiko, which break on noise before keys in pem files.

Merged from https://code.launchpad.net/~jelmer/brz/paramiko-compat/+merge/378480

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