~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tests/test_serialize_transform.py

Merge prepare-shelf into unshelve

Show diffs side-by-side

added added

removed removed

Lines of Context:
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))
 
112
 
 
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))
 
124
 
 
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'])
 
129
        tree.add('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))