/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

Partially fix pull.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
        create index if not exists trees_sha1 on trees(sha1);
62
62
""")
63
63
 
 
64
    def _parent_lookup(self, revid):
 
65
        return self.db.execute("select sha1 from commits where revid = ?", (revid,)).fetchone()[0].encode("utf-8")
 
66
 
64
67
    def add_entry(self, sha, type, type_data):
65
68
        """Add a new entry to the database.
66
69
        """
 
70
        assert isinstance(type_data, tuple)
 
71
        assert isinstance(sha, str), "type was %r" % sha
67
72
        if type == "commit":
68
73
            self.db.execute("replace into commits (sha1, revid, tree_sha) values (?, ?, ?)", (sha, type_data[0], type_data[1]))
69
74
        elif type == "blob":