Rev 2482: (robertc) Fix trivial incompatibility with bzr 0.11 servers, which give a slightly different error to bzr 0.15 servers. (Andrew Bennetts) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Mon May 7 14:42:22 BST 2007
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 2482
revision-id: pqm at pqm.ubuntu.com-20070507134218-nk6vem1ok21xv3yt
parent: pqm at pqm.ubuntu.com-20070504034556-wzcw478l7qkppkq0
parent: andrew.bennetts at canonical.com-20070430064224-hagj8m0855p1sxn7
committer: Canonical.com Patch Queue Manager<pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2007-05-07 14:42:18 +0100
message:
(robertc) Fix trivial incompatibility with bzr 0.11 servers, which give a slightly different error to bzr 0.15 servers. (Andrew Bennetts)
modified:
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
bzrlib/transport/remote.py ssh.py-20060608202016-c25gvf1ob7ypbus6-1
------------------------------------------------------------
revno: 2471.2.1
merged: andrew.bennetts at canonical.com-20070430064224-hagj8m0855p1sxn7
parent: pqm at pqm.ubuntu.com-20070430054416-kl8x12cim7g45lap
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: hpss-0.11-compat
timestamp: Mon 2007-04-30 16:42:24 +1000
message:
Fix trivial incompatibility with bzr 0.11 servers, which give a slightly different error to bzr 0.15 servers.
=== modified file 'bzrlib/tests/test_remote.py'
--- a/bzrlib/tests/test_remote.py 2007-04-30 02:04:06 +0000
+++ b/bzrlib/tests/test_remote.py 2007-04-30 06:42:24 +0000
@@ -422,6 +422,20 @@
[('call', 'Transport.is_readonly', ())],
client._calls)
+ def test_error_from_old_0_11_server(self):
+ """Same as test_error_from_old_server, but with the slightly different
+ error message from bzr 0.11 servers.
+ """
+ client = FakeClient([(
+ ('error', "Generic bzr smart protocol error: "
+ "bad request u'Transport.is_readonly'"), '')])
+ transport = RemoteTransport('bzr://example.com/', medium=False,
+ _client=client)
+ self.assertEqual(False, transport.is_readonly())
+ self.assertEqual(
+ [('call', 'Transport.is_readonly', ())],
+ client._calls)
+
class TestRemoteRepository(tests.TestCase):
"""Base for testing RemoteRepository protocol usage.
=== modified file 'bzrlib/transport/remote.py'
--- a/bzrlib/transport/remote.py 2007-04-30 04:00:06 +0000
+++ b/bzrlib/transport/remote.py 2007-04-30 06:42:24 +0000
@@ -133,8 +133,10 @@
return True
elif resp == ('no', ):
return False
- elif resp == ('error', "Generic bzr smart protocol error: "
- "bad request 'Transport.is_readonly'"):
+ elif (resp == ('error', "Generic bzr smart protocol error: "
+ "bad request 'Transport.is_readonly'") or
+ resp == ('error', "Generic bzr smart protocol error: "
+ "bad request u'Transport.is_readonly'")):
# XXX: nasty hack: servers before 0.16 don't have a
# 'Transport.is_readonly' verb, so we do what clients before 0.16
# did: assume False.
More information about the bazaar-commits
mailing list