~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_move.py

Implement move_directory by factoring out move_one
as a helper function, and then implementing a recursive update for
all moved dirblocks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
319
319
        # But it shouldn't actually move anything
320
320
        self.assertFileEqual(a_text, 'a')
321
321
        self.assertFileEqual(ba_text, 'b/a')
 
322
 
 
323
    def test_move_directory(self):
 
324
        tree = self.make_branch_and_tree('.')
 
325
        self.build_tree(['a/', 'a/b', 'a/c/', 'a/c/d', 'e/'])
 
326
        tree.add(['a', 'a/b', 'a/c', 'a/c/d', 'e'],
 
327
                 ['a-id', 'b-id', 'c-id', 'd-id', 'e-id'])
 
328
        tree.commit('initial', rev_id='rev-1')
 
329
        root_id = tree.get_root_id()
 
330
 
 
331
        tree.move(['a'], 'e')
 
332
        self.assertTreeLayout([('', root_id), ('e', 'e-id'), ('e/a', 'a-id'),
 
333
                               ('e/a/b', 'b-id'), ('e/a/c', 'c-id'),
 
334
                               ('e/a/c/d', 'd-id')], tree)