Merge lp:~spiv/bzr/rename-init_ex-verb into lp:~bzr/bzr/trunk-old

Proposed by Andrew Bennetts
Status: Merged
Merged at revision: not available
Proposed branch: lp:~spiv/bzr/rename-init_ex-verb
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 117 lines
To merge this branch: bzr merge lp:~spiv/bzr/rename-init_ex-verb
Reviewer Review Type Date Requested Status
Martin Pool Approve
Review via email: mp+7366@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Andrew Bennetts (spiv) wrote :

As discussed on IRC between jml, myself and lifeless: rename the
BzrDirFormat.initialize_ex verb to BzrDirFormat.initialize_ex_1.16 to avoid
issues with 1.15 clients expecting the old (and broken) behaviour.

Revision history for this message
Martin Pool (mbp) wrote :

I didn't follow the discussion in detail but the patch and reasoning seems ok. I presume you manually tested against an older server?

I think we're getting to the point where we should accept reality and just make the client and server know each other's versions. Just going by actual capabilities is very nice in theory, but it's not what we actually do. Guessing the version from the capabilities is the worst of both.

review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

On Fri, 2009-06-12 at 02:15 +0000, Martin Pool wrote:
> Review: Approve
> I didn't follow the discussion in detail but the patch and reasoning seems ok. I presume you manually tested against an older server?
>
> I think we're getting to the point where we should accept reality and just make the client and server know each other's versions. Just going by actual capabilities is very nice in theory, but it's not what we actually do. Guessing the version from the capabilities is the worst of both.

FWIW version numbers in the client wouldn't have helped; They may have
helped in the server, but it would have been complex given our code
structure.

-Rob

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2009-06-12 01:11:00 +0000
3+++ NEWS 2009-06-12 02:35:22 +0000
4@@ -113,6 +113,15 @@
5 * Fix rule handling so that eol is optional, not mandatory.
6 (Ian Clatworthy, #379370)
7
8+* Pushing a new stacked branch to a 1.15 smart server was broken due to a
9+ bug in the ``BzrDirFormat.initialize_ex`` smart verb. This is fixed in
10+ 1.16, but required changes to the network protocol, so the
11+ ``BzrDirFormat.initialize_ex`` verb has been removed and replaced with a
12+ corrected ``BzrDirFormat.initialize_ex_1.16`` verb. 1.15 clients will
13+ still work with a 1.16 server as they will fallback to slower (and
14+ bug-free) methods.
15+ (Jonathan Lange, Robert Collins, Andrew Bennetts, #385132)
16+
17 * Reconcile can now deal with text revisions that originated in revisions
18 that are ghosts. (Jelmer Vernooij, #336749)
19
20
21=== modified file 'bzrlib/bzrdir.py'
22--- bzrlib/bzrdir.py 2009-06-12 01:11:00 +0000
23+++ bzrlib/bzrdir.py 2009-06-12 02:35:22 +0000
24@@ -3175,7 +3175,7 @@
25 if not do_vfs:
26 client = _SmartClient(client_medium)
27 path = client.remote_path_from_transport(transport)
28- if client_medium._is_remote_before((1, 15)):
29+ if client_medium._is_remote_before((1, 16)):
30 do_vfs = True
31 if do_vfs:
32 # TODO: lookup the local format from a server hint.
33@@ -3215,9 +3215,10 @@
34 self._network_name = \
35 BzrDirFormat.get_default_format().network_name()
36 try:
37- response = client.call('BzrDirFormat.initialize_ex',
38+ response = client.call('BzrDirFormat.initialize_ex_1.16',
39 self.network_name(), path, *args)
40 except errors.UnknownSmartMethod:
41+ client._medium._remember_remote_is_before((1,16))
42 local_dir_format = BzrDirMetaFormat1()
43 self._supply_sub_formats_to(local_dir_format)
44 return local_dir_format.initialize_on_transport_ex(transport,
45
46=== modified file 'bzrlib/smart/bzrdir.py'
47--- bzrlib/smart/bzrdir.py 2009-06-11 10:11:34 +0000
48+++ bzrlib/smart/bzrdir.py 2009-06-12 02:35:22 +0000
49@@ -354,7 +354,10 @@
50 def do(self, bzrdir_network_name, path, use_existing_dir, create_prefix,
51 force_new_repo, stacked_on, stack_on_pwd, repo_format_name,
52 make_working_trees, shared_repo):
53- """Initialize a bzrdir at path as per BzrDirFormat.initialize_ex
54+ """Initialize a bzrdir at path as per
55+ BzrDirFormat.initialize_on_transport_ex.
56+
57+ New in 1.16. (Replaces BzrDirFormat.initialize_ex verb from 1.15).
58
59 :return: return SuccessfulSmartServerResponse((repo_path, rich_root,
60 tree_ref, external_lookup, repo_network_name,
61
62=== modified file 'bzrlib/smart/request.py'
63--- bzrlib/smart/request.py 2009-04-24 05:08:51 +0000
64+++ bzrlib/smart/request.py 2009-06-12 02:35:22 +0000
65@@ -492,7 +492,7 @@
66 'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
67 'SmartServerRequestInitializeBzrDir')
68 request_handlers.register_lazy(
69- 'BzrDirFormat.initialize_ex', 'bzrlib.smart.bzrdir',
70+ 'BzrDirFormat.initialize_ex_1.16', 'bzrlib.smart.bzrdir',
71 'SmartServerRequestBzrDirInitializeEx')
72 request_handlers.register_lazy(
73 'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')
74
75=== modified file 'bzrlib/tests/test_remote.py'
76--- bzrlib/tests/test_remote.py 2009-06-10 03:56:49 +0000
77+++ bzrlib/tests/test_remote.py 2009-06-12 02:35:22 +0000
78@@ -750,7 +750,7 @@
79 transport = self.get_transport()
80 client = FakeClient(transport.base)
81 client.add_expected_call(
82- 'BzrDirFormat.initialize_ex',
83+ 'BzrDirFormat.initialize_ex_1.16',
84 (default_format_name, 'path', 'False', 'False', 'False', '',
85 '', '', '', 'False'),
86 'success',
87@@ -772,7 +772,7 @@
88 transport = self.get_transport()
89 client = FakeClient(transport.base)
90 client.add_expected_call(
91- 'BzrDirFormat.initialize_ex',
92+ 'BzrDirFormat.initialize_ex_1.16',
93 (default_format_name, 'path', 'False', 'False', 'False', '',
94 '', '', '', 'False'),
95 'error',
96
97=== modified file 'bzrlib/tests/test_smart.py'
98--- bzrlib/tests/test_smart.py 2009-06-11 07:10:44 +0000
99+++ bzrlib/tests/test_smart.py 2009-06-12 02:35:22 +0000
100@@ -351,7 +351,7 @@
101
102
103 class TestSmartServerRequestBzrDirInitializeEx(tests.TestCaseWithMemoryTransport):
104- """Basic tests for BzrDir.initialize_ex in the smart server.
105+ """Basic tests for BzrDir.initialize_ex_1.16 in the smart server.
106
107 The main unit tests in test_bzrdir exercise the API comprehensively.
108 """
109@@ -1560,7 +1560,7 @@
110 smart.bzrdir.SmartServerRequestFindRepositoryV2)
111 self.assertHandlerEqual('BzrDirFormat.initialize',
112 smart.bzrdir.SmartServerRequestInitializeBzrDir)
113- self.assertHandlerEqual('BzrDirFormat.initialize_ex',
114+ self.assertHandlerEqual('BzrDirFormat.initialize_ex_1.16',
115 smart.bzrdir.SmartServerRequestBzrDirInitializeEx)
116 self.assertHandlerEqual('BzrDir.cloning_metadir',
117 smart.bzrdir.SmartServerBzrDirRequestCloningMetaDir)