/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

Use start_write_group() / commit_write_group() mechanism when creating git SHA maps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
        """List the SHA1s."""
122
122
        raise NotImplementedError(self.sha1s)
123
123
 
124
 
    def commit(self):
 
124
    def start_write_group(self):
 
125
        """Start writing changes."""
 
126
 
 
127
    def commit_write_group(self):
125
128
        """Commit any pending changes."""
126
129
 
 
130
    def abort_write_group(self):
 
131
        """Abort any pending changes."""
 
132
 
127
133
 
128
134
class DictGitShaMap(GitShaMap):
129
135
 
195
201
            return row[0].encode("utf-8")
196
202
        raise KeyError
197
203
 
198
 
    def commit(self):
 
204
    def commit_write_group(self):
199
205
        self.db.commit()
200
206
 
201
207
    def add_entries(self, entries):
321
327
    def lookup_commit(self, revid):
322
328
        return sha_to_hex(self.db["commit\0" + revid][:20])
323
329
 
324
 
    def commit(self):
325
 
        pass
326
 
 
327
330
    def add_entry(self, hexsha, type, type_data):
328
331
        """Add a new entry to the database.
329
332
        """