163
163
'wibble@fofof--20050401--1928390812'],
166
def test_commit_deleted_subtree_and_files_updates_workingtree(self):
167
"""The working trees inventory may be adjusted by commit."""
168
wt = self.make_branch_and_tree('.')
170
self.build_tree(['a', 'b/', 'b/c', 'd'])
171
wt.add(['a', 'b', 'b/c', 'd'], ['a-id', 'b-id', 'c-id', 'd-id'])
172
this_dir = self.get_transport()
173
this_dir.delete_tree('b')
175
# now we have a tree with a through d in the inventory, but only
176
# a present on disk. After commit b-id, c-id and d-id should be
177
# missing from the inventory, within the same tree transaction.
178
wt.commit('commit stuff')
179
self.assertTrue(wt.has_id('a-id'))
180
self.assertFalse(wt.has_or_had_id('b-id'))
181
self.assertFalse(wt.has_or_had_id('c-id'))
182
self.assertFalse(wt.has_or_had_id('d-id'))
183
self.assertTrue(wt.has_filename('a'))
184
self.assertFalse(wt.has_filename('b'))
185
self.assertFalse(wt.has_filename('b/c'))
186
self.assertFalse(wt.has_filename('d'))
188
# the changes should have persisted to disk - reopen the workingtree
190
wt = wt.bzrdir.open_workingtree()
192
self.assertTrue(wt.has_id('a-id'))
193
self.assertFalse(wt.has_or_had_id('b-id'))
194
self.assertFalse(wt.has_or_had_id('c-id'))
195
self.assertFalse(wt.has_or_had_id('d-id'))
196
self.assertTrue(wt.has_filename('a'))
197
self.assertFalse(wt.has_filename('b'))
198
self.assertFalse(wt.has_filename('b/c'))
199
self.assertFalse(wt.has_filename('d'))
166
203
class TestCommitProgress(TestCaseWithWorkingTree):
168
205
def restoreDefaults(self):