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

Use transports in git-import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
        """
121
121
        raise NotImplementedError(self.lookup_tree_id)
122
122
 
 
123
    def lookup_commit(self, revid):
 
124
        """Retrieve a Git commit SHA by Bazaar revision id.
 
125
        """
 
126
        raise NotImplementedError(self.lookup_commit)
 
127
 
123
128
    def revids(self):
124
129
        """List the revision ids known."""
125
130
        raise NotImplementedError(self.revids)
508
513
 
509
514
TdbBzrGitCache = lambda p: BzrGitCache(TdbGitShaMap(p), None, TdbCacheUpdater)
510
515
 
 
516
 
511
517
class TdbGitCacheFormat(BzrGitCacheFormat):
512
518
    """Cache format for tdb-based caches."""
513
519
 
516
522
 
517
523
    def open(self, transport):
518
524
        try:
519
 
            basepath = transport.local_abspath(".")
 
525
            basepath = transport.local_abspath(".").encode(osutils._fs_enc)
520
526
        except bzrlib.errors.NotLocalUrl:
521
527
            basepath = get_cache_dir()
 
528
        assert isinstance(basepath, str)
522
529
        try:
523
530
            return TdbBzrGitCache(os.path.join(basepath, "idmap.tdb"))
524
531
        except ImportError:
547
554
        if path is None:
548
555
            self.db = {}
549
556
        else:
 
557
            assert isinstance(path, str)
550
558
            if not mapdbs().has_key(path):
551
559
                mapdbs()[path] = tdb.Tdb(path, self.TDB_HASH_SIZE, tdb.DEFAULT,
552
560
                                          os.O_RDWR|os.O_CREAT)