98
103
self.assertEqual({'boo': boo_trans_id}, tt2._non_present_ids)
100
105
def test_roundtrip_modification(self):
101
LINES_ONE = 'a\nb\nc\nd\n'
102
LINES_TWO = 'z\nb\nx\nd\n'
106
LINES_ONE = 'aa\nbb\ncc\ndd\n'
107
LINES_TWO = 'z\nbb\nx\ndd\n'
103
108
tree = self.make_branch_and_tree('tree')
104
109
self.build_tree_contents([('tree/file', LINES_ONE)])
105
110
tree.add('file', 'file-id')
133
138
tt.create_file(LINES_ONE, trans_id)
134
139
self.reserialize(tt, tt2)
135
140
self.assertFileEqual(LINES_ONE, tt2._limbo_name(trans_id))
142
def test_get_parents_lines(self):
143
LINES_ONE = 'aa\nbb\ncc\ndd\n'
144
LINES_TWO = 'z\nbb\nx\ndd\n'
145
tree = self.make_branch_and_tree('tree')
146
self.build_tree_contents([('tree/file', LINES_ONE)])
147
tree.add('file', 'file-id')
148
tt, tt2 = self.get_two_previews(tree)
149
trans_id = tt.trans_id_tree_path('file')
150
self.assertEqual((['aa\n', 'bb\n', 'cc\n', 'dd\n'],),
151
get_parents_lines(tt, trans_id))
153
def test_get_parents_texts(self):
154
LINES_ONE = 'aa\nbb\ncc\ndd\n'
155
LINES_TWO = 'z\nbb\nx\ndd\n'
156
tree = self.make_branch_and_tree('tree')
157
self.build_tree_contents([('tree/file', LINES_ONE)])
158
tree.add('file', 'file-id')
159
tt, tt2 = self.get_two_previews(tree)
160
trans_id = tt.trans_id_tree_path('file')
161
self.assertEqual((LINES_ONE,),
162
get_parents_texts(tt, trans_id))