/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

More tests for sha maps, fix cache misses in tdb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
        raise NotImplementedError(self.lookup_tree)
78
78
 
79
79
    def lookup_blob(self, fileid, revid):
 
80
        """Lookup a blob by the fileid it has in a bzr revision."""
80
81
        raise NotImplementedError(self.lookup_blob)
81
82
 
82
83
    def lookup_git_sha(self, sha):
250
251
 
251
252
    "git <sha1>" -> "<type> <type-data1> <type-data2>"
252
253
    "commit revid" -> "<sha1> <tree-id>"
253
 
    "tree revid fileid" -> "<sha1>"
254
 
    "blob revid fileid" -> "<sha1>"
 
254
    "tree fileid revid" -> "<sha1>"
 
255
    "blob fileid revid" -> "<sha1>"
255
256
    """
256
257
 
257
258
    def __init__(self, path=None):
297
298
            self.db["%s %s %s" % (type, type_data[0], type_data[1])] = sha
298
299
 
299
300
    def lookup_tree(self, fileid, revid):
300
 
        return self.db["tree %s %s" % (revid, fileid)]
 
301
        return self.db["tree %s %s" % (fileid, revid)]
301
302
 
302
303
    def lookup_blob(self, fileid, revid):
303
 
        return self.db["blob %s %s" % (revid, fileid)]
 
304
        return self.db["blob %s %s" % (fileid, revid)]
304
305
 
305
306
    def lookup_git_sha(self, sha):
306
307
        """Lookup a Git sha in the database.