Rev 2226: Rename SmartClient to _SmartClient. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

Andrew Bennetts andrew.bennetts at canonical.com
Mon Apr 16 18:51:04 BST 2007


At sftp://bazaar.launchpad.net/%7Ebzr/bzr/hpss/

------------------------------------------------------------
revno: 2226
revision-id: andrew.bennetts at canonical.com-20070416174935-oieoe0rv424m14ix
parent: andrew.bennetts at canonical.com-20070416172340-1r7vaonq2ox8ncxz
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: hpss
timestamp: Tue 2007-04-17 03:49:35 +1000
message:
  Rename SmartClient to _SmartClient.
modified:
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
  bzrlib/smart/client.py         client.py-20061116014825-2k6ada6xgulslami-1
  bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
  bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
  bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2007-04-13 07:39:17 +0000
+++ b/bzrlib/bzrdir.py	2007-04-16 17:49:35 +0000
@@ -56,7 +56,7 @@
     sha_strings,
     sha_string,
     )
-from bzrlib.smart.client import SmartClient
+from bzrlib.smart.client import _SmartClient
 from bzrlib.store.revision.text import TextRevisionStore
 from bzrlib.store.text import TextStore
 from bzrlib.store.versioned import WeaveStore
@@ -2222,9 +2222,9 @@
             # TODO: lookup the local format from a server hint.
             local_dir_format = BzrDirMetaFormat1()
             return local_dir_format.initialize_on_transport(transport)
-        client = SmartClient(medium)
+        client = _SmartClient(medium)
         path = client.remote_path_from_transport(transport)
-        response = SmartClient(medium).call('BzrDirFormat.initialize', path)
+        response = _SmartClient(medium).call('BzrDirFormat.initialize', path)
         assert response[0] in ('ok', ), 'unexpected response code %s' % (response,)
         return remote.RemoteBzrDir(transport)
 

=== modified file 'bzrlib/remote.py'
--- a/bzrlib/remote.py	2007-04-16 17:23:40 +0000
+++ b/bzrlib/remote.py	2007-04-16 17:49:35 +0000
@@ -51,7 +51,7 @@
 
         if _client is None:
             self._medium = transport.get_smart_client()
-            self._client = client.SmartClient(self._medium)
+            self._client = client._SmartClient(self._medium)
         else:
             self._client = _client
             self._medium = None
@@ -168,7 +168,7 @@
 
 
 class RemoteRepositoryFormat(repository.RepositoryFormat):
-    """Format for repositories accessed over a SmartClient.
+    """Format for repositories accessed over a _SmartClient.
 
     Instances of this repository are represented by RemoteRepository
     instances.
@@ -231,7 +231,7 @@
             self._real_repository = None
         self.bzrdir = remote_bzrdir
         if _client is None:
-            self._client = client.SmartClient(self.bzrdir._medium)
+            self._client = client._SmartClient(self.bzrdir._medium)
         else:
             self._client = _client
         self._format = format
@@ -682,7 +682,7 @@
         if _client is not None:
             self._client = _client
         else:
-            self._client = client.SmartClient(self.bzrdir._medium)
+            self._client = client._SmartClient(self.bzrdir._medium)
         self.repository = remote_repository
         if real_branch is not None:
             self._real_branch = real_branch

=== modified file 'bzrlib/smart/client.py'
--- a/bzrlib/smart/client.py	2007-04-16 02:56:19 +0000
+++ b/bzrlib/smart/client.py	2007-04-16 17:49:35 +0000
@@ -20,7 +20,7 @@
 from bzrlib.urlutils import unescape
 
 
-class SmartClient(object):
+class _SmartClient(object):
 
     def __init__(self, medium):
         self._medium = medium

=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py	2007-04-16 02:56:19 +0000
+++ b/bzrlib/tests/test_remote.py	2007-04-16 17:49:35 +0000
@@ -39,7 +39,7 @@
     )
 from bzrlib.revision import NULL_REVISION
 from bzrlib.smart import server
-from bzrlib.smart.client import SmartClient
+from bzrlib.smart.client import _SmartClient
 from bzrlib.transport import remote as remote_transport
 from bzrlib.transport.memory import MemoryTransport
 
@@ -120,8 +120,8 @@
         return self._body_buffer.read(count)
 
 
-class FakeClient(SmartClient):
-    """Lookalike for SmartClient allowing testing."""
+class FakeClient(_SmartClient):
+    """Lookalike for _SmartClient allowing testing."""
     
     def __init__(self, responses):
         # We don't call the super init because there is no medium.

=== modified file 'bzrlib/tests/test_smart_transport.py'
--- a/bzrlib/tests/test_smart_transport.py	2007-04-16 02:56:19 +0000
+++ b/bzrlib/tests/test_smart_transport.py	2007-04-16 17:49:35 +0000
@@ -1447,14 +1447,14 @@
 
 
 class TestSmartClientUnicode(tests.TestCase):
-    """SmartClient tests for unicode arguments.
+    """_SmartClient tests for unicode arguments.
 
     Unicode arguments to call_with_body_bytes are not correct (remote method
     names, arguments, and bodies must all be expressed as byte strings), but
-    SmartClient should gracefully reject them, rather than getting into a broken
-    state that prevents future correct calls from working.  That is, it should
-    be possible to issue more requests on the medium afterwards, rather than
-    allowing one bad call to call_with_body_bytes to cause later calls to
+    _SmartClient should gracefully reject them, rather than getting into a
+    broken state that prevents future correct calls from working.  That is, it
+    should be possible to issue more requests on the medium afterwards, rather
+    than allowing one bad call to call_with_body_bytes to cause later calls to
     mysteriously fail with TooManyConcurrentRequests.
     """
 
@@ -1466,7 +1466,7 @@
         input = StringIO("\n")
         output = StringIO()
         client_medium = medium.SmartSimplePipesClientMedium(input, output)
-        smart_client = client.SmartClient(client_medium)
+        smart_client = client._SmartClient(client_medium)
         self.assertRaises(TypeError,
             smart_client.call_with_body_bytes, method, args, body)
         self.assertEqual("", output.getvalue())

=== modified file 'bzrlib/transport/remote.py'
--- a/bzrlib/transport/remote.py	2007-04-13 05:48:30 +0000
+++ b/bzrlib/transport/remote.py	2007-04-16 17:49:35 +0000
@@ -158,11 +158,11 @@
 
     def _call2(self, method, *args):
         """Call a method on the remote server."""
-        return client.SmartClient(self._medium).call(method, *args)
+        return client._SmartClient(self._medium).call(method, *args)
 
     def _call_with_body_bytes(self, method, args, body):
         """Call a method on the remote server with body bytes."""
-        smart_client = client.SmartClient(self._medium)
+        smart_client = client._SmartClient(self._medium)
         return smart_client.call_with_body_bytes(method, args, body)
 
     def has(self, relpath):




More information about the bazaar-commits mailing list