/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-07-03 01:51:19 UTC
  • mfrom: (6973.14.14 python3-m)
  • Revision ID: breezy.the.bot@gmail.com-20180703015119-8wqoc0wqw45irl6r
Fix more tests on Python3.

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
589
589
            basepath = transport.local_abspath(".").encode(osutils._fs_enc)
590
590
        except bzr_errors.NotLocalUrl:
591
591
            basepath = get_cache_dir()
592
 
        if type(basepath) is not str:
 
592
        if not isinstance(basepath, str):
593
593
            raise TypeError(basepath)
594
594
        try:
595
595
            return TdbBzrGitCache(os.path.join(basepath, "idmap.tdb"))
688
688
                ret.add(revid)
689
689
        return ret
690
690
 
 
691
    def _keys(self):
 
692
        try:
 
693
            return self.db.iterkeys()
 
694
        except AttributeError:
 
695
            return self.db.keys()
 
696
 
691
697
    def revids(self):
692
698
        """List the revision ids known."""
693
 
        for key in self.db.keys():
 
699
        for key in self._keys():
694
700
            if key.startswith(b"commit\0"):
695
701
                yield key[7:]
696
702
 
697
703
    def sha1s(self):
698
704
        """List the SHA1s."""
699
 
        for key in self.db.keys():
 
705
        for key in self._keys():
700
706
            if key.startswith(b"git\0"):
701
707
                yield sha_to_hex(key[4:])
702
708