672
673
parent_id_unicode = u'b\xbfse'
673
674
parent_id_utf8 = parent_id_unicode.encode('utf8')
675
vf.add_lines_with_ghosts(u'notbxbfse', [parent_id_utf8], [])
676
vf.add_lines_with_ghosts('notbxbfse', [parent_id_utf8], [])
676
677
except NotImplementedError:
677
678
# check the other ghost apis are also not implemented
678
679
self.assertRaises(NotImplementedError, vf.has_ghost, 'foo')
687
688
self.assertEqual(['notbxbfse'], vf.get_ancestry('notbxbfse'))
688
689
self.assertEqual([], vf.get_parents('notbxbfse'))
689
690
self.assertEqual({'notbxbfse':[]}, vf.get_graph())
690
self.assertFalse(vf.has_version(parent_id_unicode))
691
self.assertFalse(self.callDeprecated([osutils._revision_id_warning],
692
vf.has_version, parent_id_unicode))
691
693
self.assertFalse(vf.has_version(parent_id_utf8))
692
694
# we have _with_ghost apis to give us ghost information.
693
695
self.assertEqual([parent_id_utf8, 'notbxbfse'], vf.get_ancestry_with_ghosts(['notbxbfse']))
694
696
self.assertEqual([parent_id_utf8], vf.get_parents_with_ghosts('notbxbfse'))
695
697
self.assertEqual({'notbxbfse':[parent_id_utf8]}, vf.get_graph_with_ghosts())
696
self.assertTrue(vf.has_ghost(parent_id_unicode))
698
self.assertTrue(self.callDeprecated([osutils._revision_id_warning],
699
vf.has_ghost, parent_id_unicode))
697
700
self.assertTrue(vf.has_ghost(parent_id_utf8))
698
701
# if we add something that is a ghost of another, it should correct the
699
702
# results of the prior apis
700
vf.add_lines(parent_id_unicode, [], [])
703
self.callDeprecated([osutils._revision_id_warning],
704
vf.add_lines, parent_id_unicode, [], [])
701
705
self.assertEqual([parent_id_utf8, 'notbxbfse'], vf.get_ancestry(['notbxbfse']))
702
706
self.assertEqual([parent_id_utf8], vf.get_parents('notbxbfse'))
703
707
self.assertEqual({parent_id_utf8:[],
704
708
'notbxbfse':[parent_id_utf8],
707
self.assertTrue(vf.has_version(parent_id_unicode))
711
self.assertTrue(self.callDeprecated([osutils._revision_id_warning],
712
vf.has_version, parent_id_unicode))
708
713
self.assertTrue(vf.has_version(parent_id_utf8))
709
714
# we have _with_ghost apis to give us ghost information.
710
715
self.assertEqual([parent_id_utf8, 'notbxbfse'], vf.get_ancestry_with_ghosts(['notbxbfse']))
713
718
'notbxbfse':[parent_id_utf8],
715
720
vf.get_graph_with_ghosts())
716
self.assertFalse(vf.has_ghost(parent_id_unicode))
721
self.assertFalse(self.callDeprecated([osutils._revision_id_warning],
722
vf.has_ghost, parent_id_unicode))
717
723
self.assertFalse(vf.has_ghost(parent_id_utf8))
719
725
def test_add_lines_with_ghosts_after_normal_revs(self):