~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_mv.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-03-18 02:49:45 UTC
  • mfrom: (3249.4.2 mv.dir.after)
  • Revision ID: pqm@pqm.ubuntu.com-20080318024945-zhs03078h06fbk6l
(Lukas Lalinsky) Make 'mv a b' work for already renamed directories,
 like it does for files. (#107967)

Show diffs side-by-side

added added

removed removed

Lines of Context:
407
407
        self.failUnlessExists('sub/a2')
408
408
        self.assertInWorkingTree('sub/a1')
409
409
        self.assertInWorkingTree('sub/a2')
 
410
 
 
411
    def test_mv_already_moved_directory(self):
 
412
        """Use `bzr mv a b` to mark a directory as renamed.
 
413
 
 
414
        https://bugs.launchpad.net/bzr/+bug/107967/
 
415
        """
 
416
        self.build_tree(['a/', 'c/'])
 
417
        tree = self.make_branch_and_tree('.')
 
418
        tree.add(['a', 'c'])
 
419
        osutils.rename('a', 'b')
 
420
        osutils.rename('c', 'd')
 
421
        # mv a b should work just like it does for already renamed files
 
422
        self.run_bzr('mv a b')
 
423
        self.failIfExists('a')
 
424
        self.assertNotInWorkingTree('a')
 
425
        self.failUnlessExists('b')
 
426
        self.assertInWorkingTree('b')
 
427
        # and --after should work, too (technically it's ignored)
 
428
        self.run_bzr('mv --after c d')
 
429
        self.failIfExists('c')
 
430
        self.assertNotInWorkingTree('c')
 
431
        self.failUnlessExists('d')
 
432
        self.assertInWorkingTree('d')