125
125
tree3 = b.revision_tree('test@rev-3')
126
126
self.assertFalse(tree3.has_filename('hello'))
127
127
self.assertEquals(tree3.get_file_text('buongia-id'), 'new text')
130
def test_commit_rename(self):
131
"""Test commit of a revision where a file is renamed."""
132
b = Branch('.', init=True)
133
self.build_tree(['hello'])
134
b.add(['hello'], ['hello-id'])
135
b.commit(message='one', rev_id='test@rev-1', allow_pointless=False)
137
b.rename_one('hello', 'fruity')
138
b.commit(message='renamed', rev_id='test@rev-2', allow_pointless=False)
140
tree1 = b.revision_tree('test@rev-1')
141
self.assertEquals(tree1.id2path('hello-id'), 'hello')
142
self.assertEquals(tree1.get_file_text('hello-id'), 'contents of hello\n')
143
self.assertFalse(tree1.has_filename('fruity'))
145
tree2 = b.revision_tree('test@rev-2')
146
self.assertEquals(tree2.id2path('hello-id'), 'fruity')
147
self.assertEquals(tree2.get_file_text('hello-id'), 'contents of hello\n')
148
self.assertFalse(tree2.has_filename('hello'))
131
151
def test_removed_commit(self):
132
152
"""Test a commit with a removed file"""
133
153
b = Branch('.', init=True)