116
116
"""Check output from version command and master option is reasonable"""
117
117
# output is intentionally passed through to stdout so that we
118
118
# can see the version being tested
119
output = self.run_bzr(['version'])[0]
119
output = self.run_bzr('version')[0]
120
120
self.log('bzr version output:')
122
122
self.assert_(output.startswith('Bazaar (bzr) '))
123
123
self.assertNotEqual(output.index('Canonical'), -1)
124
124
# make sure --version is consistent
125
tmp_output = self.run_bzr(['--version'])[0]
125
tmp_output = self.run_bzr('--version')[0]
126
126
self.assertEquals(output, tmp_output)
128
128
def example_branch(test):
505
504
self.assertEquals(os.readlink("d2/link1"), "NOWHERE1")
506
505
self.run_bzr('add d2/link3')
507
506
self.run_bzr('diff', retcode=1)
508
self.run_bzr(['commit', '-m', '3: rename of dir, move symlinks, add link3'])
507
self.run_bzr(['commit', '-m',
508
'3: rename of dir, move symlinks, add link3'])
510
510
os.unlink("link2")
511
511
os.symlink("TARGET 2", "link2")
512
512
os.unlink("d2/link1")
514
514
self.run_bzr('diff', retcode=1)
515
515
self.assertEquals(self.run_bzr("relpath d2/link1")[0], "d2/link1\n")
516
516
self.run_bzr(['commit', '-m', '4: retarget of two links'])
518
518
self.run_bzr('remove --keep d2/link1')
519
519
self.assertEquals(self.run_bzr('unknowns')[0], 'd2/link1\n')
520
520
self.run_bzr(['commit', '-m', '5: remove d2/link1'])
524
524
self.run_bzr('rm --keep d2/link1')
525
525
self.assertEquals(self.run_bzr('unknowns')[0], 'd2/link1\n')
526
526
self.run_bzr(['commit', '-m', '7: remove d2/link1'])
529
529
self.run_bzr('add d1')
530
530
self.run_bzr('rename d2/link3 d1/link3new')
531
531
self.assertEquals(self.run_bzr('unknowns')[0], 'd2/link1\n')
532
self.run_bzr(['commit', '-m', '8: remove d2/link1, move/rename link3'])
534
self.run_bzr(['check'])
536
self.run_bzr(['export', '-r', '1', 'exp1.tmp'])
532
self.run_bzr(['commit', '-m',
533
'8: remove d2/link1, move/rename link3'])
535
self.run_bzr('check')
537
self.run_bzr('export -r 1 exp1.tmp')
537
538
chdir("exp1.tmp")
538
539
self.assertEquals(listdir_sorted("."), [ "link1" ])
539
540
self.assertEquals(os.readlink("link1"), "NOWHERE1")
542
self.run_bzr(['export', '-r', '2', 'exp2.tmp'])
543
self.run_bzr('export -r 2 exp2.tmp')
543
544
chdir("exp2.tmp")
544
545
self.assertEquals(listdir_sorted("."), [ "d1", "link1" ])
547
self.run_bzr(['export', '-r', '3', 'exp3.tmp'])
548
self.run_bzr('export -r 3 exp3.tmp')
548
549
chdir("exp3.tmp")
549
550
self.assertEquals(listdir_sorted("."), [ "d2", "link2" ])
550
551
self.assertEquals(listdir_sorted("d2"), [ "link1", "link3" ])
551
552
self.assertEquals(os.readlink("d2/link1"), "NOWHERE1")
552
553
self.assertEquals(os.readlink("link2") , "NOWHERE2")
555
self.run_bzr(['export', '-r', '4', 'exp4.tmp'])
556
self.run_bzr('export -r 4 exp4.tmp')
556
557
chdir("exp4.tmp")
557
558
self.assertEquals(listdir_sorted("."), [ "d2", "link2" ])
558
559
self.assertEquals(os.readlink("d2/link1"), "TARGET 1")
559
560
self.assertEquals(os.readlink("link2") , "TARGET 2")
560
561
self.assertEquals(listdir_sorted("d2"), [ "link1", "link3" ])
563
self.run_bzr(['export', '-r', '5', 'exp5.tmp'])
564
self.run_bzr('export -r 5 exp5.tmp')
564
565
chdir("exp5.tmp")
565
566
self.assertEquals(listdir_sorted("."), [ "d2", "link2" ])
566
567
self.assert_(os.path.islink("link2"))
567
568
self.assert_(listdir_sorted("d2")== [ "link3" ])
570
self.run_bzr(['export', '-r', '8', 'exp6.tmp'])
571
self.run_bzr('export -r 8 exp6.tmp')
571
572
chdir("exp6.tmp")
572
573
self.assertEqual(listdir_sorted("."), [ "d1", "d2", "link2"])
573
574
self.assertEquals(listdir_sorted("d1"), [ "link3new" ])