109
109
tt.create_file(LINES_TWO, trans_id)
110
110
self.reserialize(tt, tt2)
111
111
self.assertFileEqual(LINES_TWO, tt2._limbo_name(trans_id))
113
def test_roundtrip_kind_change(self):
114
LINES_ONE = 'a\nb\nc\nd\n'
115
tree = self.make_branch_and_tree('tree')
116
self.build_tree(['tree/foo/'])
117
tree.add('foo', 'foo-id')
118
tt, tt2 = self.get_two_previews(tree)
119
trans_id = tt.trans_id_file_id('foo-id')
120
tt.delete_contents(trans_id)
121
tt.create_file(LINES_ONE, trans_id)
122
self.reserialize(tt, tt2)
123
self.assertFileEqual(LINES_ONE, tt2._limbo_name(trans_id))
125
def test_roundtrip_add_contents(self):
126
LINES_ONE = 'a\nb\nc\nd\n'
127
tree = self.make_branch_and_tree('tree')
128
self.build_tree(['tree/foo'])
130
os.unlink('tree/foo')
131
tt, tt2 = self.get_two_previews(tree)
132
trans_id = tt.trans_id_tree_path('foo')
133
tt.create_file(LINES_ONE, trans_id)
134
self.reserialize(tt, tt2)
135
self.assertFileEqual(LINES_ONE, tt2._limbo_name(trans_id))