Rev 4228: (robertc) No longer call _ensure_real in in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Apr 1 06:40:59 BST 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4228
revision-id: pqm at pqm.ubuntu.com-20090401054055-ljlwhq6q0w6eju8s
parent: pqm at pqm.ubuntu.com-20090401045536-om9uljc07rrcknxi
parent: robertc at robertcollins.net-20090401040529-vwb8tpu42jk2m0w6
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-04-01 06:40:55 +0100
message:
(robertc) No longer call _ensure_real in
RemoteRepository.add_fallback_repository. (Robert Collins,
Andrew Bennetts)
modified:
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
------------------------------------------------------------
revno: 4226.1.2
revision-id: robertc at robertcollins.net-20090401040529-vwb8tpu42jk2m0w6
parent: robertc at robertcollins.net-20090401035319-i5d3i8jnyp3jxryz
committer: Robert Collins <robertc at robertcollins.net>
branch nick: RemoteRepository.add_fallback_repo
timestamp: Wed 2009-04-01 15:05:29 +1100
message:
Fix test_remote failing because of less _real_repository objects.
modified:
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
------------------------------------------------------------
revno: 4226.1.1
revision-id: robertc at robertcollins.net-20090401035319-i5d3i8jnyp3jxryz
parent: pqm at pqm.ubuntu.com-20090401030426-i2p8321efq55f7jm
committer: Robert Collins <robertc at robertcollins.net>
branch nick: RemoteRepository.add_fallback_repo
timestamp: Wed 2009-04-01 14:53:19 +1100
message:
RemoteRepository.add_fallback_repository no longer calls ensure_real. (Robert Collins, Andrew Bennetts)
modified:
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/tests/blackbox/test_branch.py test_branch.py-20060524161337-noms9gmcwqqrfi8y-1
bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py 2009-03-31 23:23:07 +0000
+++ b/bzrlib/remote.py 2009-04-01 03:53:19 +0000
@@ -844,6 +844,8 @@
self._real_repository.lock_read()
else:
self._lock_count += 1
+ for repo in self._fallback_repositories:
+ repo.lock_read()
def _remote_lock_write(self, token):
path = self.bzrdir._path_for_remote_call(self._client)
@@ -884,6 +886,9 @@
raise errors.ReadOnlyError(self)
else:
self._lock_count += 1
+ for repo in self._fallback_repositories:
+ # Writes don't affect fallback repos
+ repo.lock_read()
return self._lock_token or None
def leave_lock_in_place(self):
@@ -1053,10 +1058,6 @@
if self._real_repository is not None:
if repository not in self._real_repository._fallback_repositories:
self._real_repository.add_fallback_repository(repository)
- else:
- # They are also seen by the fallback repository. If it doesn't
- # exist yet they'll be added then. This implicitly copies them.
- self._ensure_real()
def add_inventory(self, revid, inv, parents):
self._ensure_real()
=== modified file 'bzrlib/tests/blackbox/test_branch.py'
--- a/bzrlib/tests/blackbox/test_branch.py 2009-03-24 06:40:26 +0000
+++ b/bzrlib/tests/blackbox/test_branch.py 2009-04-01 03:53:19 +0000
@@ -307,7 +307,7 @@
# being too low. If rpc_count increases, more network roundtrips have
# become necessary for this use case. Please do not adjust this number
# upwards without agreement from bzr's network support maintainers.
- self.assertLength(23, self.hpss_calls)
+ self.assertLength(15, self.hpss_calls)
class TestRemoteBranch(TestCaseWithSFTPServer):
=== modified file 'bzrlib/tests/blackbox/test_push.py'
--- a/bzrlib/tests/blackbox/test_push.py 2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/blackbox/test_push.py 2009-04-01 03:53:19 +0000
@@ -217,7 +217,7 @@
# being too low. If rpc_count increases, more network roundtrips have
# become necessary for this use case. Please do not adjust this number
# upwards without agreement from bzr's network support maintainers.
- self.assertLength(56, self.hpss_calls)
+ self.assertLength(52, self.hpss_calls)
remote = Branch.open('public')
self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py 2009-03-31 23:23:07 +0000
+++ b/bzrlib/tests/test_remote.py 2009-04-01 04:05:29 +0000
@@ -999,11 +999,10 @@
result = branch.get_stacked_on_url()
self.assertEqual('../base', result)
client.finished_test()
- # it's in the fallback list both for the RemoteRepository and its vfs
- # repository
+ # it's in the fallback list both for the RemoteRepository.
self.assertEqual(1, len(branch.repository._fallback_repositories))
- self.assertEqual(1,
- len(branch.repository._real_repository._fallback_repositories))
+ # And we haven't had to construct a real repository.
+ self.assertEqual(None, branch.repository._real_repository)
class TestBranchSetLastRevision(RemoteBranchTestCase):
More information about the bazaar-commits
mailing list