1296
1296
verb = 'Branch.set_parent_location'
1297
1297
self.disable_verb(verb)
1298
1298
branch.set_parent('http://foo/')
1299
self.assertLength(14, self.hpss_calls)
1299
self.assertLength(13, self.hpss_calls)
1302
1302
class TestBranchGetTagsBytes(RemoteBranchTestCase):
1457
1457
def test_backwards_compatible(self):
1458
br = self.make_branch_with_tags()
1459
br.get_config_stack().set('branch.fetch_tags', True)
1460
self.addCleanup(br.lock_read().unlock)
1458
branch = self.make_branch_with_tags()
1459
c = branch.get_config_stack()
1460
c.set('branch.fetch_tags', True)
1461
self.addCleanup(branch.lock_read().unlock)
1461
1462
# Disable the heads_to_fetch verb
1462
1463
verb = 'Branch.heads_to_fetch'
1463
1464
self.disable_verb(verb)
1464
1465
self.reset_smart_call_log()
1465
result = br.heads_to_fetch()
1466
result = branch.heads_to_fetch()
1466
1467
self.assertEqual((set(['tip']), set(['rev-1', 'rev-2'])), result)
1467
1468
self.assertEqual(
1468
['Branch.last_revision_info', 'Branch.get_tags_bytes'],
1469
['Branch.last_revision_info', 'Branch.get_config_file',
1470
'Branch.get_tags_bytes'],
1469
1471
[call.call.method for call in self.hpss_calls])
1471
1473
def test_backwards_compatible_no_tags(self):
1472
br = self.make_branch_with_tags()
1473
br.get_config_stack().set('branch.fetch_tags', False)
1474
self.addCleanup(br.lock_read().unlock)
1474
branch = self.make_branch_with_tags()
1475
c = branch.get_config_stack()
1476
c.set('branch.fetch_tags', False)
1477
self.addCleanup(branch.lock_read().unlock)
1475
1478
# Disable the heads_to_fetch verb
1476
1479
verb = 'Branch.heads_to_fetch'
1477
1480
self.disable_verb(verb)
1478
1481
self.reset_smart_call_log()
1479
result = br.heads_to_fetch()
1482
result = branch.heads_to_fetch()
1480
1483
self.assertEqual((set(['tip']), set()), result)
1481
1484
self.assertEqual(
1482
['Branch.last_revision_info'],
1485
['Branch.last_revision_info', 'Branch.get_config_file'],
1483
1486
[call.call.method for call in self.hpss_calls])
2070
2073
'Branch.get_config_file', ('memory:///', ),
2071
2074
'success', ('ok', ), "# line 1\n")
2072
2075
client.add_expected_call(
2073
'Branch.get_config_file', ('memory:///', ),
2074
'success', ('ok', ), "# line 1\n")
2075
client.add_expected_call(
2076
2076
'Branch.put_config_file', ('memory:///', 'branch token',
2078
2078
'success', ('ok',))
2090
2090
[('call', 'Branch.get_stacked_on_url', ('memory:///',)),
2091
2091
('call', 'Branch.lock_write', ('memory:///', '', '')),
2092
2092
('call_expecting_body', 'Branch.get_config_file', ('memory:///',)),
2093
('call_expecting_body', 'Branch.get_config_file', ('memory:///',)),
2094
2093
('call_with_body_bytes_expecting_body', 'Branch.put_config_file',
2095
2094
('memory:///', 'branch token', 'repo token'),
2096
2095
'# line 1\nemail = The Dude <lebowski@example.com>\n'),