~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-07-13 18:38:58 UTC
  • mfrom: (1863 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1869.
  • Revision ID: john@arbash-meinel.com-20060713183858-ebf4aa1f9ef8bb6e
[merge] bzr.dev 1863

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
        self.runbzr('revert')
148
148
        os.chdir('..')
149
149
 
150
 
    def test_mv_modes(self):
151
 
        """Test two modes of operation for mv"""
152
 
        self.runbzr('init')
153
 
        self.build_tree(['a', 'c', 'subdir/'])
154
 
        self.run_bzr_captured(['add', self.test_dir])
155
 
        self.run_bzr_captured(['mv', 'a', 'b'])
156
 
        self.run_bzr_captured(['mv', 'b', 'subdir'])
157
 
        self.run_bzr_captured(['mv', 'subdir/b', 'a'])
158
 
        self.run_bzr_captured(['mv', 'a', 'c', 'subdir'])
159
 
        self.run_bzr_captured(['mv', 'subdir/a', 'subdir/newa'])
160
 
 
161
150
    def test_main_version(self):
162
151
        """Check output from version command and master option is reasonable"""
163
152
        # output is intentionally passed through to stdout so that we
677
666
        out = capture("help ci")
678
667
        out.index('aliases: ')
679
668
 
680
 
        progress("can't rename unversioned file")
681
 
        runbzr("rename test.txt new-test.txt", 3)
682
 
 
683
 
        progress("adding a file")
684
 
 
685
 
        runbzr("add test.txt")
686
 
        self.assertEquals(capture("unknowns"), '')
687
 
 
688
 
        progress("rename newly-added file")
689
 
        runbzr("rename test.txt hello.txt")
690
 
        self.assert_(os.path.exists("hello.txt"))
691
 
        self.assert_(not os.path.exists("test.txt"))
692
 
 
693
 
        self.assertEquals(capture("revno"), '0\n')
694
 
 
695
 
        progress("add first revision")
696
 
        runbzr(['commit', '-m', 'add first revision'])
697
 
 
698
 
        progress("more complex renames")
699
 
        os.mkdir("sub1")
700
 
        runbzr("rename hello.txt sub1", 3)
701
 
        runbzr("rename hello.txt sub1/hello.txt", 3)
702
 
        runbzr("move hello.txt sub1", 3)
703
 
 
704
 
        runbzr("add sub1")
705
 
        runbzr("rename sub1 sub2")
706
 
        runbzr("move hello.txt sub2")
707
 
        self.assertEqual(capture("relpath sub2/hello.txt"),
708
 
                         pathjoin("sub2", "hello.txt\n"))
709
 
 
710
 
        self.assert_(exists("sub2"))
711
 
        self.assert_(exists("sub2/hello.txt"))
712
 
        self.assert_(not exists("sub1"))
713
 
        self.assert_(not exists("hello.txt"))
714
 
 
715
 
        runbzr(['commit', '-m', 'commit with some things moved to subdirs'])
716
 
 
717
 
        mkdir("sub1")
718
 
        runbzr('add sub1')
719
 
        runbzr('move sub2/hello.txt sub1')
720
 
        self.assert_(not exists('sub2/hello.txt'))
721
 
        self.assert_(exists('sub1/hello.txt'))
722
 
        runbzr('move sub2 sub1')
723
 
        self.assert_(not exists('sub2'))
724
 
        self.assert_(exists('sub1/sub2'))
725
 
 
726
 
        runbzr(['commit', '-m', 'rename nested subdirectories'])
727
 
 
728
 
        chdir('sub1/sub2')
729
 
        self.assertEquals(capture('root')[:-1],
730
 
                          pathjoin(self.test_dir, 'branch1'))
731
 
        runbzr('move ../hello.txt .')
732
 
        self.assert_(exists('./hello.txt'))
733
 
        self.assertEquals(capture('relpath hello.txt'),
734
 
                          pathjoin('sub1', 'sub2', 'hello.txt') + '\n')
735
 
        self.assertEquals(capture('relpath ../../sub1/sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
736
 
        runbzr(['commit', '-m', 'move to parent directory'])
737
 
        chdir('..')
738
 
        self.assertEquals(capture('relpath sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
739
 
 
740
 
        runbzr('move sub2/hello.txt .')
741
 
        self.assert_(exists('hello.txt'))
742
 
 
743
669
        f = file('hello.txt', 'wt')
744
670
        f.write('some nice new content\n')
745
671
        f.close()
746
672
 
 
673
        runbzr("add hello.txt")
 
674
        
747
675
        f = file('msg.tmp', 'wt')
748
676
        f.write('this is my new commit\nand it has multiple lines, for fun')
749
677
        f.close()
750
678
 
751
679
        runbzr('commit -F msg.tmp')
752
680
 
753
 
        self.assertEquals(capture('revno'), '5\n')
754
 
        runbzr('export -r 5 export-5.tmp')
 
681
        self.assertEquals(capture('revno'), '1\n')
 
682
        runbzr('export -r 1 export-1.tmp')
755
683
        runbzr('export export.tmp')
756
684
 
757
685
        runbzr('log')