Rev 4438: (andrew) Rename BzrDirFormat.initialize_ex verb to in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Jun 12 04:44:18 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4438
revision-id: pqm at pqm.ubuntu.com-20090612034412-oi5ll5wrbarb2w7s
parent: pqm at pqm.ubuntu.com-20090612011100-89h4a819eqx1ym98
parent: andrew.bennetts at canonical.com-20090612014843-y2q18pp74tv2v632
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2009-06-12 04:44:12 +0100
message:
  (andrew) Rename BzrDirFormat.initialize_ex verb to
  	BzrDirFormat.initialize_ex_1.16.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
  bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
  bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
  bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
    ------------------------------------------------------------
    revno: 4436.1.1
    revision-id: andrew.bennetts at canonical.com-20090612014843-y2q18pp74tv2v632
    parent: pqm at pqm.ubuntu.com-20090611234313-nd7scz9zpd66zilj
    committer: Andrew Bennetts <andrew.bennetts at canonical.com>
    branch nick: rename-init_ex-verb
    timestamp: Fri 2009-06-12 11:48:43 +1000
    message:
      Rename BzrDirFormat.initialize_ex verb to BzrDirFormat.initialize_ex_1.16.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
      bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
=== modified file 'NEWS'
--- a/NEWS	2009-06-12 01:11:00 +0000
+++ b/NEWS	2009-06-12 03:44:12 +0000
@@ -113,6 +113,15 @@
 * Fix rule handling so that eol is optional, not mandatory.
   (Ian Clatworthy, #379370)
 
+* Pushing a new stacked branch to a 1.15 smart server was broken due to a
+  bug in the ``BzrDirFormat.initialize_ex`` smart verb.  This is fixed in
+  1.16, but required changes to the network protocol, so the
+  ``BzrDirFormat.initialize_ex`` verb has been removed and replaced with a
+  corrected ``BzrDirFormat.initialize_ex_1.16`` verb.  1.15 clients will
+  still work with a 1.16 server as they will fallback to slower (and
+  bug-free) methods.
+  (Jonathan Lange, Robert Collins, Andrew Bennetts, #385132)
+
 * Reconcile can now deal with text revisions that originated in revisions 
   that are ghosts. (Jelmer Vernooij, #336749)
 

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2009-06-12 01:11:00 +0000
+++ b/bzrlib/bzrdir.py	2009-06-12 03:44:12 +0000
@@ -3175,7 +3175,7 @@
         if not do_vfs:
             client = _SmartClient(client_medium)
             path = client.remote_path_from_transport(transport)
-            if client_medium._is_remote_before((1, 15)):
+            if client_medium._is_remote_before((1, 16)):
                 do_vfs = True
         if do_vfs:
             # TODO: lookup the local format from a server hint.
@@ -3215,9 +3215,10 @@
             self._network_name = \
             BzrDirFormat.get_default_format().network_name()
         try:
-            response = client.call('BzrDirFormat.initialize_ex',
+            response = client.call('BzrDirFormat.initialize_ex_1.16',
                 self.network_name(), path, *args)
         except errors.UnknownSmartMethod:
+            client._medium._remember_remote_is_before((1,16))
             local_dir_format = BzrDirMetaFormat1()
             self._supply_sub_formats_to(local_dir_format)
             return local_dir_format.initialize_on_transport_ex(transport,

=== modified file 'bzrlib/smart/bzrdir.py'
--- a/bzrlib/smart/bzrdir.py	2009-06-11 10:11:34 +0000
+++ b/bzrlib/smart/bzrdir.py	2009-06-12 01:48:43 +0000
@@ -354,7 +354,10 @@
     def do(self, bzrdir_network_name, path, use_existing_dir, create_prefix,
         force_new_repo, stacked_on, stack_on_pwd, repo_format_name,
         make_working_trees, shared_repo):
-        """Initialize a bzrdir at path as per BzrDirFormat.initialize_ex
+        """Initialize a bzrdir at path as per
+        BzrDirFormat.initialize_on_transport_ex.
+
+        New in 1.16.  (Replaces BzrDirFormat.initialize_ex verb from 1.15).
 
         :return: return SuccessfulSmartServerResponse((repo_path, rich_root,
             tree_ref, external_lookup, repo_network_name,

=== modified file 'bzrlib/smart/request.py'
--- a/bzrlib/smart/request.py	2009-04-24 05:08:51 +0000
+++ b/bzrlib/smart/request.py	2009-06-12 01:48:43 +0000
@@ -492,7 +492,7 @@
     'BzrDirFormat.initialize', 'bzrlib.smart.bzrdir',
     'SmartServerRequestInitializeBzrDir')
 request_handlers.register_lazy(
-    'BzrDirFormat.initialize_ex', 'bzrlib.smart.bzrdir',
+    'BzrDirFormat.initialize_ex_1.16', 'bzrlib.smart.bzrdir',
     'SmartServerRequestBzrDirInitializeEx')
 request_handlers.register_lazy(
     'BzrDir.open', 'bzrlib.smart.bzrdir', 'SmartServerRequestOpenBzrDir')

=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py	2009-06-10 03:56:49 +0000
+++ b/bzrlib/tests/test_remote.py	2009-06-12 01:48:43 +0000
@@ -750,7 +750,7 @@
         transport = self.get_transport()
         client = FakeClient(transport.base)
         client.add_expected_call(
-            'BzrDirFormat.initialize_ex',
+            'BzrDirFormat.initialize_ex_1.16',
                 (default_format_name, 'path', 'False', 'False', 'False', '',
                  '', '', '', 'False'),
             'success',
@@ -772,7 +772,7 @@
         transport = self.get_transport()
         client = FakeClient(transport.base)
         client.add_expected_call(
-            'BzrDirFormat.initialize_ex',
+            'BzrDirFormat.initialize_ex_1.16',
                 (default_format_name, 'path', 'False', 'False', 'False', '',
                  '', '', '', 'False'),
             'error',

=== modified file 'bzrlib/tests/test_smart.py'
--- a/bzrlib/tests/test_smart.py	2009-06-11 07:10:44 +0000
+++ b/bzrlib/tests/test_smart.py	2009-06-12 01:48:43 +0000
@@ -351,7 +351,7 @@
 
 
 class TestSmartServerRequestBzrDirInitializeEx(tests.TestCaseWithMemoryTransport):
-    """Basic tests for BzrDir.initialize_ex in the smart server.
+    """Basic tests for BzrDir.initialize_ex_1.16 in the smart server.
 
     The main unit tests in test_bzrdir exercise the API comprehensively.
     """
@@ -1560,7 +1560,7 @@
             smart.bzrdir.SmartServerRequestFindRepositoryV2)
         self.assertHandlerEqual('BzrDirFormat.initialize',
             smart.bzrdir.SmartServerRequestInitializeBzrDir)
-        self.assertHandlerEqual('BzrDirFormat.initialize_ex',
+        self.assertHandlerEqual('BzrDirFormat.initialize_ex_1.16',
             smart.bzrdir.SmartServerRequestBzrDirInitializeEx)
         self.assertHandlerEqual('BzrDir.cloning_metadir',
             smart.bzrdir.SmartServerBzrDirRequestCloningMetaDir)




More information about the bazaar-commits mailing list