Rev 3877: Another fix for bug #304841. As a broad-spectrum solution, in http://bzr.arbash-meinel.com/branches/bzr/1.10-dev/304841-not-present-chain
John Arbash Meinel
john at arbash-meinel.com
Wed Dec 3 22:28:11 GMT 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.10-dev/304841-not-present-chain
------------------------------------------------------------
revno: 3877
revision-id: john at arbash-meinel.com-20081203222758-s30tazlndlw7env0
parent: john at arbash-meinel.com-20081203222454-f91otv07o8zgo2nv
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 304841-not-present-chain
timestamp: Wed 2008-12-03 16:27:58 -0600
message:
Another fix for bug #304841. As a broad-spectrum solution,
always request in topological order.
-------------- next part --------------
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py 2008-12-02 05:11:07 +0000
+++ b/bzrlib/repository.py 2008-12-03 22:27:58 +0000
@@ -581,6 +581,7 @@
self.inventories.add_fallback_versioned_files(repository.inventories)
self.revisions.add_fallback_versioned_files(repository.revisions)
self.signatures.add_fallback_versioned_files(repository.signatures)
+ self._fetch_order = 'topological'
def _check_fallback_repository(self, repository):
"""Check that this repository can fallback to repository safely.
=== modified file 'bzrlib/tests/per_repository/test_add_fallback_repository.py'
--- a/bzrlib/tests/per_repository/test_add_fallback_repository.py 2008-09-04 20:32:04 +0000
+++ b/bzrlib/tests/per_repository/test_add_fallback_repository.py 2008-12-03 22:27:58 +0000
@@ -45,3 +45,13 @@
# ... or on the repository directly...
self.assertEqual({revision_id: (NULL_REVISION,)},
repo.get_parent_map([revision_id]))
+
+ def test_add_fallback_sets_fetch_order(self):
+ repo = self.make_repository('repo')
+ tree = self.make_branch_and_tree('branch')
+ if not repo._format.supports_external_lookups:
+ self.assertRaises(errors.UnstackableRepositoryFormat,
+ repo.add_fallback_repository, tree.branch.repository)
+ raise TestNotApplicable
+ repo.add_fallback_repository(tree.branch.repository)
+ self.assertEqual('topological', repo._fetch_order)
=== modified file 'bzrlib/tests/test_fetch.py'
--- a/bzrlib/tests/test_fetch.py 2008-12-03 22:22:24 +0000
+++ b/bzrlib/tests/test_fetch.py 2008-12-03 22:27:58 +0000
@@ -474,7 +474,7 @@
# F
# A & B are present in the base (stacked-on) repository, A-E are
# present in the source.
- # This is attempting to reproduce bug #304841
+ # This reproduces bug #304841
# We need a large enough inventory that total size of compressed deltas
# is shorter than the size of a compressed fulltext. We have to use
# random ids because otherwise the inventory fulltext compresses too
More information about the bazaar-commits
mailing list