/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Marius Kruger
  • Date: 2007-02-16 06:16:11 UTC
  • mto: This revision was merged to the branch mainline in revision 2455.
  • Revision ID: amanic@gmail.com-20070216061611-sjscmgi4v5rozq6h
"bzr remove" and "bzr rm" will now remove the working file.
This has been done for consistency with svn and the unix rm command.

The old remove behaviour has been retained in the new command
"bzr unversion", which will just stop versioning the file,
but not delete it.
(Addressing Bug #82602)

Exisitng tests have been reworked and new tests were added to test these
changes properly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
521
521
            runbzr('diff', retcode=1)
522
522
            self.assertEquals(self.capture("relpath d2/link1"), "d2/link1\n")
523
523
            runbzr(['commit', '-m', '4: retarget of two links'])
524
 
    
 
524
 
 
525
            # unversion
 
526
            runbzr('unversion d2/link1')
 
527
            self.assertEquals(self.capture('unknowns'), 'd2/link1\n')
 
528
            runbzr(['commit', '-m', '5: unversion d2/link1'])
 
529
            self.assertEquals(self.capture('unknowns'), 'd2/link1\n')
 
530
 
 
531
            # remove
 
532
            runbzr('add d2/link1')
 
533
            runbzr(['commit', '-m', '6: add d2/link1'])
525
534
            runbzr('remove d2/link1')
526
 
            self.assertEquals(self.capture('unknowns'), 'd2/link1\n')
527
 
            runbzr(['commit', '-m', '5: remove d2/link1'])
 
535
            self.assertEquals(self.capture('unknowns'), '')
 
536
            self.assertTrue(self.capture('status --short d2/link1').find(
 
537
                'd2/link1') >= 0)
 
538
            runbzr(['commit', '-m', '7: remove d2/link1'])
 
539
 
528
540
            # try with the rm alias
 
541
            os.symlink("TARGET 1", "d2/link1")
529
542
            runbzr('add d2/link1')
530
 
            runbzr(['commit', '-m', '6: add d2/link1'])
 
543
            runbzr(['commit', '-m', '8: add d2/link1'])
531
544
            runbzr('rm d2/link1')
532
 
            self.assertEquals(self.capture('unknowns'), 'd2/link1\n')
533
 
            runbzr(['commit', '-m', '7: remove d2/link1'])
534
 
    
 
545
            self.assertEquals(self.capture('unknowns'), '')
 
546
            self.assertTrue(self.capture('status --short d2/link1').find(
 
547
                'd2/link1') >= 0)
 
548
            runbzr(['commit', '-m', '9: unknown d2/link1'])
 
549
 
535
550
            os.mkdir("d1")
536
551
            runbzr('add d1')
537
552
            runbzr('rename d2/link3 d1/link3new')
538
 
            self.assertEquals(self.capture('unknowns'), 'd2/link1\n')
539
 
            runbzr(['commit', '-m', '8: remove d2/link1, move/rename link3'])
 
553
            runbzr(['commit', '-m', '10: add d1, move/rename link3'])
540
554
            
541
555
            runbzr(['check'])
542
556
            
574
588
            self.assert_(listdir_sorted("d2")== [ "link3" ])
575
589
            chdir("..")
576
590
            
577
 
            runbzr(['export', '-r', '8', 'exp6.tmp'])
 
591
            runbzr(['export', '-r', '10', 'exp6.tmp'])
578
592
            chdir("exp6.tmp")
579
593
            self.assertEqual(listdir_sorted("."), [ "d1", "d2", "link2"])
580
594
            self.assertEquals(listdir_sorted("d1"), [ "link3new" ])