Rev 4111: (mbp) code cleanups and SmartSSHClientMedium repr in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Mar 11 06:25:18 GMT 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4111
revision-id: pqm at pqm.ubuntu.com-20090311062514-cuxe92b6jnavadru
parent: pqm at pqm.ubuntu.com-20090311015637-v73ocbv9bcexe4dm
parent: mbp at sourcefrog.net-20090311052357-jyjgg8cx7tveprei
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2009-03-11 06:25:14 +0000
message:
(mbp) code cleanups and SmartSSHClientMedium repr
modified:
bzrlib/smart/medium.py medium.py-20061103051856-rgu2huy59fkz902q-1
bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
------------------------------------------------------------
revno: 4100.1.3
revision-id: mbp at sourcefrog.net-20090311052357-jyjgg8cx7tveprei
parent: mbp at sourcefrog.net-20090310065015-36pov0w2hc1dh452
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: trivial
timestamp: Wed 2009-03-11 15:23:57 +1000
message:
Remove test_ssh_client_changes_command_when_BZR_REMOTE_PATH_is_set
BZR_REMOTE_PATH is now handled at a higher level (and tested by a blackbox
test) not by SmartSSHClientMedium.
modified:
bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
------------------------------------------------------------
revno: 4100.1.2
revision-id: mbp at sourcefrog.net-20090310065015-36pov0w2hc1dh452
parent: mbp at sourcefrog.net-20090310024941-9qr1zh562mr8oh6a
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: trivial
timestamp: Tue 2009-03-10 16:50:15 +1000
message:
review tweaks
modified:
bzrlib/smart/medium.py medium.py-20061103051856-rgu2huy59fkz902q-1
------------------------------------------------------------
revno: 4100.1.1
revision-id: mbp at sourcefrog.net-20090310024941-9qr1zh562mr8oh6a
parent: pqm at pqm.ubuntu.com-20090310012923-c8el0n6v75v4ycd1
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: trivial
timestamp: Tue 2009-03-10 12:49:41 +1000
message:
Cleanup and add SmartSSHClientMedium repr
modified:
bzrlib/smart/medium.py medium.py-20061103051856-rgu2huy59fkz902q-1
=== modified file 'bzrlib/smart/medium.py'
--- a/bzrlib/smart/medium.py 2009-03-10 04:57:28 +0000
+++ b/bzrlib/smart/medium.py 2009-03-11 06:25:14 +0000
@@ -738,11 +738,14 @@
self._vendor = vendor
self._write_to = None
self._bzr_remote_path = bzr_remote_path
- if self._bzr_remote_path is None:
- symbol_versioning.warn(
- 'bzr_remote_path is required as of bzr 0.92',
- DeprecationWarning, stacklevel=2)
- self._bzr_remote_path = os.environ.get('BZR_REMOTE_PATH', 'bzr')
+
+ def __repr__(self):
+ return "%s(connected=%r, username=%r, host=%r, port=%r)" % (
+ self.__class__.__name__,
+ self._connected,
+ self._username,
+ self._host,
+ self._port)
def _accept_bytes(self, bytes):
"""See SmartClientStreamMedium.accept_bytes."""
=== modified file 'bzrlib/tests/test_smart_transport.py'
--- a/bzrlib/tests/test_smart_transport.py 2009-03-06 06:48:25 +0000
+++ b/bzrlib/tests/test_smart_transport.py 2009-03-11 05:23:57 +0000
@@ -263,27 +263,6 @@
['bzr', 'serve', '--inet', '--directory=/', '--allow-writes'])],
vendor.calls)
- def test_ssh_client_changes_command_when_BZR_REMOTE_PATH_is_set(self):
- # The only thing that initiates a connection from the medium is giving
- # it bytes.
- output = StringIO()
- vendor = StringIOSSHVendor(StringIO(), output)
- orig_bzr_remote_path = os.environ.get('BZR_REMOTE_PATH')
- def cleanup_environ():
- osutils.set_or_unset_env('BZR_REMOTE_PATH', orig_bzr_remote_path)
- self.addCleanup(cleanup_environ)
- os.environ['BZR_REMOTE_PATH'] = 'fugly'
- client_medium = self.callDeprecated(
- ['bzr_remote_path is required as of bzr 0.92'],
- medium.SmartSSHClientMedium, 'a hostname', 'a port', 'a username',
- 'a password', 'base', vendor)
- client_medium._accept_bytes('abc')
- self.assertEqual('abc', output.getvalue())
- self.assertEqual([('connect_ssh', 'a username', 'a password',
- 'a hostname', 'a port',
- ['fugly', 'serve', '--inet', '--directory=/', '--allow-writes'])],
- vendor.calls)
-
def test_ssh_client_changes_command_when_bzr_remote_path_passed(self):
# The only thing that initiates a connection from the medium is giving
# it bytes.
More information about the bazaar-commits
mailing list