Rev 4086: Review feedback. in http://people.ubuntu.com/~robertc/baz2.0/branch.roundtrips
Robert Collins
robertc at robertcollins.net
Fri Mar 6 04:38:59 GMT 2009
At http://people.ubuntu.com/~robertc/baz2.0/branch.roundtrips
------------------------------------------------------------
revno: 4086
revision-id: robertc at robertcollins.net-20090306043856-1w5vzs5ebv93zyda
parent: robertc at robertcollins.net-20090306035527-sm1gsd3nh3f2mxpa
committer: Robert Collins <robertc at robertcollins.net>
branch nick: branch.roundtrips
timestamp: Fri 2009-03-06 15:38:56 +1100
message:
Review feedback.
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py 2009-03-06 03:55:27 +0000
+++ b/bzrlib/branch.py 2009-03-06 04:38:56 +0000
@@ -580,11 +580,8 @@
:seealso: Branch._get_tags_bytes.
"""
- self.lock_write()
- try:
- self._transport.put_bytes('tags', bytes)
- finally:
- self.unlock()
+ return _run_with_write_locked_target(self, self._transport.put_bytes,
+ 'tags', bytes)
def _cache_revision_history(self, rev_history):
"""Set the cached revision history to rev_history.
=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py 2009-03-06 03:55:27 +0000
+++ b/bzrlib/remote.py 2009-03-06 04:38:56 +0000
@@ -162,13 +162,13 @@
if repo_name:
format.repository_format = repository.network_format_registry.get(
repo_name)
- if branch_ref == 'reference':
+ if branch_ref == 'ref':
# XXX: we need possible_transports here to avoid reopening the
# connection to the referenced location
ref_bzrdir = BzrDir.open(branch_name)
branch_format = ref_bzrdir.cloning_metadir().get_branch_format()
format.set_branch_format(branch_format)
- elif branch_ref == 'direct':
+ elif branch_ref == 'branch':
if branch_name:
format.set_branch_format(
branch.network_format_registry.get(branch_name))
=== modified file 'bzrlib/smart/bzrdir.py'
--- a/bzrlib/smart/bzrdir.py 2009-03-06 03:55:27 +0000
+++ b/bzrlib/smart/bzrdir.py 2009-03-06 04:38:56 +0000
@@ -110,14 +110,14 @@
if branch_ref is not None:
# If there's a branch reference, the client will have to resolve
# the branch reference to figure out the cloning metadir
- branch_name = ('reference', branch_ref)
+ branch_name = ('ref', branch_ref)
else:
- branch_name = (
- 'direct', control_format.get_branch_format().network_name())
+ branch_name = ('branch',
+ control_format.get_branch_format().network_name())
repository_name = control_format.repository_format.network_name()
else:
# Only MetaDir has delegated formats today.
- branch_name = ''
+ branch_name = ('branch', '')
repository_name = ''
return SuccessfulSmartServerResponse((control_name, repository_name,
branch_name))
=== modified file 'bzrlib/tests/blackbox/test_branch.py'
--- a/bzrlib/tests/blackbox/test_branch.py 2009-03-06 03:55:27 +0000
+++ b/bzrlib/tests/blackbox/test_branch.py 2009-03-06 04:38:56 +0000
@@ -289,7 +289,6 @@
# 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.debug()
self.assertEqual(11, rpc_count)
=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py 2009-03-06 03:55:27 +0000
+++ b/bzrlib/tests/test_remote.py 2009-03-06 04:38:56 +0000
@@ -376,7 +376,7 @@
control_name = reference_bzrdir_format.network_name()
client.add_expected_call(
'BzrDir.cloning_metadir', ('quack/', 'False'),
- 'success', (control_name, '', ('direct', ''))),
+ 'success', (control_name, '', ('branch', ''))),
a_bzrdir = RemoteBzrDir(transport, remote.RemoteBzrDirFormat(),
_client=client)
result = a_bzrdir.cloning_metadir()
=== modified file 'bzrlib/tests/test_smart.py'
--- a/bzrlib/tests/test_smart.py 2009-03-06 03:55:27 +0000
+++ b/bzrlib/tests/test_smart.py 2009-03-06 04:38:56 +0000
@@ -177,7 +177,7 @@
expected = SuccessfulSmartServerResponse(
(local_result.network_name(),
local_result.repository_format.network_name(),
- ('direct', local_result.get_branch_format().network_name())))
+ ('branch', local_result.get_branch_format().network_name())))
self.assertEqual(expected, request.execute('', 'False'))
def test_cloning_metadir_reference(self):
@@ -196,7 +196,7 @@
expected = SuccessfulSmartServerResponse(
(local_result.network_name(),
local_result.repository_format.network_name(),
- ('reference', reference_url)))
+ ('ref', reference_url)))
self.assertEqual(expected, request.execute('', 'False'))
More information about the bazaar-commits
mailing list