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

Cope with repositories that don't have a _transport attribute.

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
    @classmethod
277
277
    def from_repository(cls, repository):
278
278
        try:
279
 
            return cls(os.path.join(repository._transport.local_abspath("."), "git.tdb"))
 
279
            transport = getattr(repository, "_transport", None)
 
280
            if transport is not None:
 
281
                return cls(os.path.join(transport.local_abspath("."), "git.tdb"))
280
282
        except bzrlib.errors.NotLocalUrl:
281
 
            from bzrlib.config import config_dir
282
 
            return cls(os.path.join(config_dir(), "remote-git.tdb"))
 
283
            pass
 
284
        from bzrlib.config import config_dir
 
285
        return cls(os.path.join(config_dir(), "remote-git.tdb"))
283
286
 
284
287
    def lookup_commit(self, revid):
285
288
        return self.db["commit %s" % revid].split(" ")[0]