Rev 3053: PackRepository.get_ancestry() tells its indexes that it should buffer before it starts grabbing all of history. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration
John Arbash Meinel
john at arbash-meinel.com
Thu Nov 29 23:29:40 GMT 2007
At http://bzr.arbash-meinel.com/branches/bzr/jam-integration
------------------------------------------------------------
revno: 3053
revision-id:john at arbash-meinel.com-20071129232902-xlmhssl1u4lyct64
parent: pqm at pqm.ubuntu.com-20071129184101-u9506rihe4zbzyyz
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Thu 2007-11-29 17:29:02 -0600
message:
PackRepository.get_ancestry() tells its indexes that it should buffer before it starts grabbing all of history.
modified:
bzrlib/index.py index.py-20070712131115-lolkarso50vjr64s-1
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
-------------- next part --------------
=== modified file 'bzrlib/index.py'
--- a/bzrlib/index.py 2007-11-28 00:59:30 +0000
+++ b/bzrlib/index.py 2007-11-29 23:29:02 +0000
@@ -1114,6 +1114,11 @@
for index in self._indices:
index.validate()
+ def buffer_all(self):
+ for index in self._indices:
+ if index._nodes is None:
+ index._buffer_all()
+
class InMemoryGraphIndex(GraphIndexBuilder):
"""A GraphIndex which operates entirely out of memory and is mutable.
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py 2007-11-28 21:55:07 +0000
+++ b/bzrlib/repofmt/pack_repo.py 2007-11-29 23:29:02 +0000
@@ -1602,6 +1602,21 @@
pb.finished()
return result
+ @needs_read_lock
+ def get_ancestry(self, revision_id, topo_sorted=True):
+ """Return a list of revision-ids integrated by a revision.
+
+ This is topologically sorted, unless 'topo_sorted' is specified as
+ False.
+ """
+ if _mod_revision.is_null(revision_id):
+ return [None]
+ self._pack_collection.ensure_loaded()
+ index = self._pack_collection.revision_index.combined_index
+ index.buffer_all()
+ return super(KnitPackRepository, self).get_ancestry(
+ revision_id=revision_id, topo_sorted=topo_sorted)
+
def get_parents(self, revision_ids):
"""See StackedParentsProvider.get_parents.
More information about the bazaar-commits
mailing list