729
def test_add_tree_reference(self):
730
# make a dirstate and add a tree reference
731
state = dirstate.DirState.initialize('dirstate')
733
('', 'subdir', 'subdir-id'),
734
[('t', 'subtree-123123', 0, False,
735
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')],
738
state.add('subdir', 'subdir-id', 'tree-reference', None, 'subtree-123123')
739
entry = state._get_entry(0, 'subdir-id', 'subdir')
740
self.assertEqual(entry, expected_entry)
745
# now check we can read it back
749
entry2 = state._get_entry(0, 'subdir-id', 'subdir')
750
self.assertEqual(entry, entry2)
751
self.assertEqual(entry, expected_entry)
752
# and lookup by id should work too
753
entry2 = state._get_entry(0, fileid_utf8='subdir-id')
754
self.assertEqual(entry, expected_entry)
730
759
class TestGetLines(TestCaseWithDirState):