~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 00:05:14 UTC
  • mfrom: (1861 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1871.
  • Revision ID: john@arbash-meinel.com-20060713000514-aa62627aa0d4deb6
[merge] bzr.dev 1861

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
        self.runbzr('revert')
124
124
        os.chdir('..')
125
125
 
126
 
    def test_mv_modes(self):
127
 
        """Test two modes of operation for mv"""
128
 
        self.runbzr('init')
129
 
        self.build_tree(['a', 'c', 'subdir/'])
130
 
        self.run_bzr_captured(['add', self.test_dir])
131
 
        self.run_bzr_captured(['mv', 'a', 'b'])
132
 
        self.run_bzr_captured(['mv', 'b', 'subdir'])
133
 
        self.run_bzr_captured(['mv', 'subdir/b', 'a'])
134
 
        self.run_bzr_captured(['mv', 'a', 'c', 'subdir'])
135
 
        self.run_bzr_captured(['mv', 'subdir/a', 'subdir/newa'])
136
 
 
137
126
    def test_main_version(self):
138
127
        """Check output from version command and master option is reasonable"""
139
128
        # output is intentionally passed through to stdout so that we
526
515
        out = capture("help ci")
527
516
        out.index('aliases: ')
528
517
 
529
 
        progress("can't rename unversioned file")
530
 
        runbzr("rename test.txt new-test.txt", 3)
531
 
 
532
 
        progress("adding a file")
533
 
 
534
 
        runbzr("add test.txt")
535
 
        self.assertEquals(capture("unknowns"), '')
536
 
 
537
 
        progress("rename newly-added file")
538
 
        runbzr("rename test.txt hello.txt")
539
 
        self.assert_(os.path.exists("hello.txt"))
540
 
        self.assert_(not os.path.exists("test.txt"))
541
 
 
542
 
        self.assertEquals(capture("revno"), '0\n')
543
 
 
544
 
        progress("add first revision")
545
 
        runbzr(['commit', '-m', 'add first revision'])
546
 
 
547
 
        progress("more complex renames")
548
 
        os.mkdir("sub1")
549
 
        runbzr("rename hello.txt sub1", 3)
550
 
        runbzr("rename hello.txt sub1/hello.txt", 3)
551
 
        runbzr("move hello.txt sub1", 3)
552
 
 
553
 
        runbzr("add sub1")
554
 
        runbzr("rename sub1 sub2")
555
 
        runbzr("move hello.txt sub2")
556
 
        self.assertEqual(capture("relpath sub2/hello.txt"),
557
 
                         pathjoin("sub2", "hello.txt\n"))
558
 
 
559
 
        self.assert_(exists("sub2"))
560
 
        self.assert_(exists("sub2/hello.txt"))
561
 
        self.assert_(not exists("sub1"))
562
 
        self.assert_(not exists("hello.txt"))
563
 
 
564
 
        runbzr(['commit', '-m', 'commit with some things moved to subdirs'])
565
 
 
566
 
        mkdir("sub1")
567
 
        runbzr('add sub1')
568
 
        runbzr('move sub2/hello.txt sub1')
569
 
        self.assert_(not exists('sub2/hello.txt'))
570
 
        self.assert_(exists('sub1/hello.txt'))
571
 
        runbzr('move sub2 sub1')
572
 
        self.assert_(not exists('sub2'))
573
 
        self.assert_(exists('sub1/sub2'))
574
 
 
575
 
        runbzr(['commit', '-m', 'rename nested subdirectories'])
576
 
 
577
 
        chdir('sub1/sub2')
578
 
        self.assertEquals(capture('root')[:-1],
579
 
                          pathjoin(self.test_dir, 'branch1'))
580
 
        runbzr('move ../hello.txt .')
581
 
        self.assert_(exists('./hello.txt'))
582
 
        self.assertEquals(capture('relpath hello.txt'),
583
 
                          pathjoin('sub1', 'sub2', 'hello.txt') + '\n')
584
 
        self.assertEquals(capture('relpath ../../sub1/sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
585
 
        runbzr(['commit', '-m', 'move to parent directory'])
586
 
        chdir('..')
587
 
        self.assertEquals(capture('relpath sub2/hello.txt'), pathjoin('sub1', 'sub2', 'hello.txt\n'))
588
 
 
589
 
        runbzr('move sub2/hello.txt .')
590
 
        self.assert_(exists('hello.txt'))
591
 
 
592
518
        f = file('hello.txt', 'wt')
593
519
        f.write('some nice new content\n')
594
520
        f.close()
595
521
 
 
522
        runbzr("add hello.txt")
 
523
        
596
524
        f = file('msg.tmp', 'wt')
597
525
        f.write('this is my new commit\nand it has multiple lines, for fun')
598
526
        f.close()
599
527
 
600
528
        runbzr('commit -F msg.tmp')
601
529
 
602
 
        self.assertEquals(capture('revno'), '5\n')
603
 
        runbzr('export -r 5 export-5.tmp')
 
530
        self.assertEquals(capture('revno'), '1\n')
 
531
        runbzr('export -r 1 export-1.tmp')
604
532
        runbzr('export export.tmp')
605
533
 
606
534
        runbzr('log')