Rev 1254: Commit every 1000 revisions rather than every 1000 db operations. in http://people.samba.org/bzr/jelmer/bzr-svn/svn-1.5
Jelmer Vernooij
jelmer at samba.org
Thu Jun 26 17:56:30 BST 2008
At http://people.samba.org/bzr/jelmer/bzr-svn/svn-1.5
------------------------------------------------------------
revno: 1254
revision-id: jelmer at samba.org-20080626165630-1sbz5ppcncpnkvx8
parent: jelmer at samba.org-20080626165526-ob00qi6qnv13ydv7
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: svn-1.5
timestamp: Thu 2008-06-26 18:56:30 +0200
message:
Commit every 1000 revisions rather than every 1000 db operations.
modified:
logwalker.py logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
=== modified file 'logwalker.py'
--- a/logwalker.py 2008-06-26 16:55:26 +0000
+++ b/logwalker.py 2008-06-26 16:56:30 +0000
@@ -223,7 +223,6 @@
(rev, path, action, copyfrom_path, copyfrom_rev)
VALUES (?, ?, ?, ?, ?)
""", (rev, path, action, copyfrom_path, copyfrom_rev))
- self._commit_conditionally()
def get_revprops(self, revnum):
"""Retrieve all the cached revision properties.
@@ -248,7 +247,6 @@
self.cachedb.execute("""
REPLACE INTO revprop (rev, name, value) VALUES (?, ?, ?)
""", (rev, name, value))
- self._commit_conditionally()
def has_all_revprops(self, revnum):
"""Check whether all revprops for a revision have been cached.
@@ -268,14 +266,13 @@
self.cachedb.execute("""
REPLACE INTO revinfo (rev, all_revprops) VALUES (?, ?)
""", (rev, all_revprops))
- self._commit_conditionally()
def commit(self):
"""Commit the cache database."""
self.cachedb.commit()
self.commit_countdown = 1000
- def _commit_conditionally(self):
+ def commit_conditionally(self):
self.commit_countdown -= 1
if self.commit_countdown <= 0:
self.commit()
@@ -776,6 +773,7 @@
for k,v in revprops.items():
self.cache.insert_revprop(revision, k, v)
self.cache.insert_revinfo(revision, todo_revprops is None)
+ self.cache.commit_conditionally()
url = urlutils.join(self._transport.get_svn_repos_root(), path)
self.mutter("Fetching revisions %d:%d from %r (%r)", from_revnum, to_revnum, path, url)
More information about the bazaar-commits
mailing list