197
197
transport = MemoryTransport()
198
198
transport.mkdir('quack')
199
199
transport = transport.clone('quack')
200
client = FakeClient([(('ok', ''), ), (('ok', '', 'no', 'no'), )],
200
client = FakeClient([(('ok', ''), ), (('ok', '', 'no', 'no', 'no'), )],
202
202
bzrdir = RemoteBzrDir(transport, _client=client)
203
203
result = bzrdir.open_branch()
204
204
self.assertEqual(
205
205
[('call', 'BzrDir.open_branch', ('quack/',)),
206
('call', 'BzrDir.find_repository', ('quack/',))],
206
('call', 'BzrDir.find_repositoryV2', ('quack/',))],
208
208
self.assertIsInstance(result, RemoteBranch)
209
209
self.assertEqual(bzrdir, result.bzrdir)
240
240
# Relpaths on the wire should not be URL-escaped. So "~" should be
241
241
# transmitted as "~", not "%7E".
242
242
transport = RemoteTransport('bzr://localhost/~hello/')
243
client = FakeClient([(('ok', ''), ), (('ok', '', 'no', 'no'), )],
243
client = FakeClient([(('ok', ''), ), (('ok', '', 'no', 'no', 'no'), )],
245
245
bzrdir = RemoteBzrDir(transport, _client=client)
246
246
result = bzrdir.open_branch()
247
247
self.assertEqual(
248
248
[('call', 'BzrDir.open_branch', ('~hello/',)),
249
('call', 'BzrDir.find_repository', ('~hello/',))],
249
('call', 'BzrDir.find_repositoryV2', ('~hello/',))],
252
def check_open_repository(self, rich_root, subtrees):
252
def check_open_repository(self, rich_root, subtrees, external_lookup='no'):
253
253
transport = MemoryTransport()
254
254
transport.mkdir('quack')
255
255
transport = transport.clone('quack')
261
261
subtree_response = 'yes'
263
263
subtree_response = 'no'
264
client = FakeClient([(('ok', '', rich_response, subtree_response), ),],
265
[(('ok', '', rich_response, subtree_response, external_lookup), ),],
266
267
bzrdir = RemoteBzrDir(transport, _client=client)
267
268
result = bzrdir.open_repository()
268
269
self.assertEqual(
269
[('call', 'BzrDir.find_repository', ('quack/',))],
270
[('call', 'BzrDir.find_repositoryV2', ('quack/',))],
271
272
self.assertIsInstance(result, RemoteRepository)
272
273
self.assertEqual(bzrdir, result.bzrdir)
278
279
self.check_open_repository(False, True)
279
280
self.check_open_repository(True, False)
280
281
self.check_open_repository(False, False)
282
self.check_open_repository(False, False, 'yes')
282
284
def test_old_server(self):
283
285
"""RemoteBzrDirFormat should fail to probe if the server version is too