359
359
self.assertRaises(errors.OutSideTransaction, f.add_lines, '', [], [])
360
360
self.assertRaises(errors.OutSideTransaction, f.add_lines_with_ghosts, '', [], [])
361
361
self.assertRaises(errors.OutSideTransaction, f.join, '')
362
self.assertRaises(errors.OutSideTransaction, f.clone_text, 'base', 'bar', ['foo'])
364
363
def test_clear_cache(self):
365
364
f = self.get_file()
373
372
def test_clone_text(self):
374
373
f = self.get_file()
375
374
f.add_lines('r0', [], ['a\n', 'b\n'])
376
f.clone_text('r1', 'r0', ['r0'])
375
self.applyDeprecated(one_four, f.clone_text, 'r1', 'r0', ['r0'])
377
376
def verify_file(f):
378
377
self.assertEquals(f.get_lines('r1'), f.get_lines('r0'))
379
378
self.assertEquals(f.get_lines('r1'), ['a\n', 'b\n'])
380
379
self.assertEqual({'r1':('r0',)}, f.get_parent_map(['r1']))
381
380
self.assertRaises(RevisionNotPresent,
382
f.clone_text, 'r2', 'rX', [])
381
self.applyDeprecated, one_four, f.clone_text, 'r2', 'rX', [])
383
382
self.assertRaises(RevisionAlreadyPresent,
384
f.clone_text, 'r1', 'r0', [])
383
self.applyDeprecated, one_four, f.clone_text, 'r1', 'r0', [])
386
385
verify_file(self.reopen_file())
706
705
self.assertRaises(errors.ReadOnlyError, vf.join, 'base')
707
self.assertRaises(errors.ReadOnlyError, vf.clone_text, 'base', 'bar', ['foo'])
709
707
def test_get_sha1s(self):
710
708
# check the sha1 data is available