Rev 4345: Remove duplicate optimised-but-to-be-changed pack implementation of _find_inconsistent_revision_parents. in http://people.ubuntu.com/~robertc/baz2.0/check
Robert Collins
robertc at robertcollins.net
Tue May 12 04:57:25 BST 2009
At http://people.ubuntu.com/~robertc/baz2.0/check
------------------------------------------------------------
revno: 4345
revision-id: robertc at robertcollins.net-20090512035722-dwxda3gbdr8iatcz
parent: robertc at robertcollins.net-20090512035039-6x0pahpjpkdnm9zb
committer: Robert Collins <robertc at robertcollins.net>
branch nick: check
timestamp: Tue 2009-05-12 13:57:22 +1000
message:
Remove duplicate optimised-but-to-be-changed pack implementation of _find_inconsistent_revision_parents.
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py 2009-04-27 23:14:00 +0000
+++ b/bzrlib/repofmt/pack_repo.py 2009-05-12 03:57:22 +0000
@@ -2204,52 +2204,6 @@
def _abort_write_group(self):
self._pack_collection._abort_write_group()
- def _find_inconsistent_revision_parents(self):
- """Find revisions with incorrectly cached parents.
-
- :returns: an iterator yielding tuples of (revison-id, parents-in-index,
- parents-in-revision).
- """
- if not self.is_locked():
- raise errors.ObjectNotLocked(self)
- pb = ui.ui_factory.nested_progress_bar()
- result = []
- try:
- revision_nodes = self._pack_collection.revision_index \
- .combined_index.iter_all_entries()
- index_positions = []
- # Get the cached index values for all revisions, and also the
- # location in each index of the revision text so we can perform
- # linear IO.
- for index, key, value, refs in revision_nodes:
- node = (index, key, value, refs)
- index_memo = self.revisions._index._node_to_position(node)
- if index_memo[0] != index:
- raise AssertionError('%r != %r' % (index_memo[0], index))
- index_positions.append((index_memo, key[0],
- tuple(parent[0] for parent in refs[0])))
- pb.update("Reading revision index", 0, 0)
- index_positions.sort()
- batch_size = 1000
- pb.update("Checking cached revision graph", 0,
- len(index_positions))
- for offset in xrange(0, len(index_positions), 1000):
- pb.update("Checking cached revision graph", offset)
- to_query = index_positions[offset:offset + batch_size]
- if not to_query:
- break
- rev_ids = [item[1] for item in to_query]
- revs = self.get_revisions(rev_ids)
- for revision, item in zip(revs, to_query):
- index_parents = item[2]
- rev_parents = tuple(revision.parent_ids)
- if index_parents != rev_parents:
- result.append((revision.revision_id, index_parents,
- rev_parents))
- finally:
- pb.finished()
- return result
-
def _make_parents_provider(self):
return graph.CachingParentsProvider(self)
More information about the bazaar-commits
mailing list