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