~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2007-04-20 20:36:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2440.
  • Revision ID: john@arbash-meinel.com-20070420203630-tmc7pwdid0mhkg77
Add a test for moving a directory where a child has been moved into a subdir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
                              ], tree)
376
376
        tree._validate()
377
377
 
 
378
    def test_move_directory_with_children_in_subdir(self):
 
379
        tree = self.make_branch_and_tree('.')
 
380
        self.build_tree(['a/', 'a/b', 'a/c/', 'd/'])
 
381
        tree.add(['a', 'a/b', 'a/c', 'd'],
 
382
                 ['a-id', 'b-id', 'c-id', 'd-id'])
 
383
        tree.commit('initial', rev_id='rev-1')
 
384
        root_id = tree.get_root_id()
 
385
 
 
386
 
 
387
        tree.rename_one('a/b', 'a/c/b')
 
388
        self.assertTreeLayout([('', root_id),
 
389
                               ('a', 'a-id'),
 
390
                               ('d', 'd-id'),
 
391
                               ('a/c', 'c-id'),
 
392
                               ('a/c/b', 'b-id'),
 
393
                              ], tree)
 
394
        self.assertEqual([('a', 'd/a')],
 
395
                         tree.move(['a'], 'd'))
 
396
        self.assertTreeLayout([('', root_id),
 
397
                               ('d', 'd-id'),
 
398
                               ('d/a', 'a-id'),
 
399
                               ('d/a/c', 'c-id'),
 
400
                               ('d/a/c/b', 'b-id'),
 
401
                              ], tree)
 
402
        tree._validate()
 
403
 
378
404
    def test_move_directory_with_deleted_children(self):
379
405
        tree = self.make_branch_and_tree('.')
380
406
        self.build_tree(['a/', 'a/b', 'a/c', 'a/d', 'b/'])