/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

More work on roundtrip push support.

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