67
67
self.assert_(os.path.exists('subdir1'))
68
68
self.assert_(os.path.exists('subdir1/.bzr'))
70
self.runbzr('init subdir2/nothere', retcode=2)
70
self.runbzr('init subdir2/nothere', retcode=3)
72
72
os.mkdir('subdir2')
73
73
self.runbzr('init subdir2')
74
self.runbzr('init subdir2', retcode=1)
74
self.runbzr('init subdir2', retcode=3)
76
76
self.runbzr('init subdir2/subsubdir1')
77
77
self.assert_(os.path.exists('subdir2/subsubdir1/.bzr'))
122
122
def test_invalid_commands(self):
123
self.runbzr("pants", retcode=1)
124
self.runbzr("--pants off", retcode=1)
125
self.runbzr("diff --message foo", retcode=1)
123
self.runbzr("pants", retcode=3)
124
self.runbzr("--pants off", retcode=3)
125
self.runbzr("diff --message foo", retcode=3)
127
127
def test_empty_commit(self):
128
128
self.runbzr("init")
129
129
self.build_tree(['hello.txt'])
130
self.runbzr("commit -m empty", retcode=1)
130
self.runbzr("commit -m empty", retcode=3)
131
131
self.runbzr("add hello.txt")
132
132
self.runbzr("commit -m added")
135
135
self.runbzr("init")
136
136
file('foo.c', 'wt').write('int main() {}')
137
137
self.runbzr(['add', 'foo.c'])
138
self.runbzr(["commit", "-m", ""] , retcode=1)
138
self.runbzr(["commit", "-m", ""] , retcode=3)
140
140
def test_other_branch_commit(self):
141
141
# this branch is to ensure consistent behaviour, whether we're run
152
152
self.runbzr(['add', 'branch/foo.c'])
153
153
self.runbzr(['add', 'branch'])
154
154
# can't commit files in different trees; sane error
155
self.runbzr('commit -m newstuff branch/foo.c .', retcode=1)
155
self.runbzr('commit -m newstuff branch/foo.c .', retcode=3)
156
156
self.runbzr('commit -m newstuff branch/foo.c')
157
157
self.runbzr('commit -m newstuff branch')
158
self.runbzr('commit -m newstuff branch', retcode=1)
158
self.runbzr('commit -m newstuff branch', retcode=3)
161
161
def test_ignore_patterns(self):
375
375
file('hello', 'wt').write('quuux')
376
376
# We can't merge when there are in-tree changes
377
self.runbzr('merge ../b', retcode=1)
377
self.runbzr('merge ../b', retcode=3)
378
378
self.runbzr(['commit', '-m', "Like an epidemic of u's"])
379
379
self.runbzr('merge ../b -r last:1..last:1 --merge-type blooof',
381
381
self.runbzr('merge ../b -r last:1..last:1 --merge-type merge3')
382
382
self.runbzr('revert --no-backup')
383
383
self.runbzr('merge ../b -r last:1..last:1 --merge-type weave')
439
439
self.example_branch()
440
self.runbzr('pull', retcode=1)
441
self.runbzr('missing', retcode=1)
440
self.runbzr('pull', retcode=3)
441
self.runbzr('missing', retcode=3)
442
442
self.runbzr('missing .')
443
443
self.runbzr('missing')
444
444
self.runbzr('pull')
445
self.runbzr('pull /', retcode=1)
445
self.runbzr('pull /', retcode=3)
446
446
self.runbzr('pull')
463
463
self.runbzr('commit -m blah3 --unchanged')
465
self.runbzr('pull ../a', retcode=1)
465
self.runbzr('pull ../a', retcode=3)
467
467
self.runbzr('branch b overwriteme')
468
468
os.chdir('overwriteme')
502
502
open('a', 'wb').write('hello\n')
504
504
# Can't supply both
505
bzr('ls --verbose --null', retcode=1)
505
bzr('ls --verbose --null', retcode=3)
508
508
ls_equals('? a\n', '--verbose')
596
596
self.runbzr('init')
597
597
self.runbzr('commit -m unchanged --unchanged')
598
self.runbzr('pull', retcode=1)
599
self.runbzr('merge', retcode=1)
598
self.runbzr('pull', retcode=3)
599
self.runbzr('merge', retcode=3)
600
600
self.runbzr('branch . ../b')
602
602
self.runbzr('pull')
641
641
def test_unknown_command(self):
642
642
"""Handling of unknown command."""
643
643
out, err = self.run_bzr_captured(['fluffy-badger'],
645
645
self.assertEquals(out, '')
646
646
err.index('unknown command')
682
682
self.runbzr('remerge hello --merge-type weave', retcode=1)
683
683
assert os.path.exists('hello.OTHER')
684
684
file_id = self.runbzr('file-id hello')
685
file_id = self.runbzr('file-id hello.THIS', retcode=1)
685
file_id = self.runbzr('file-id hello.THIS', retcode=3)
686
686
self.runbzr('remerge --merge-type weave', retcode=1)
687
687
assert os.path.exists('hello.OTHER')
688
688
assert not os.path.exists('hello.BASE')
689
689
assert '|||||||' not in conflict_text
690
690
assert 'hi world' not in conflict_text
691
self.runbzr('remerge . --merge-type weave --show-base', retcode=2)
692
self.runbzr('remerge . --merge-type weave --reprocess', retcode=2)
693
self.runbzr('remerge . --show-base --reprocess', retcode=1)
691
self.runbzr('remerge . --merge-type weave --show-base', retcode=3)
692
self.runbzr('remerge . --merge-type weave --reprocess', retcode=3)
693
self.runbzr('remerge . --show-base --reprocess', retcode=3)
694
694
self.runbzr('remerge hello --show-base', retcode=1)
695
695
self.runbzr('remerge hello --reprocess', retcode=1)
696
696
self.runbzr('resolve --all')
697
697
self.runbzr('commit -m done',)
698
self.runbzr('remerge', retcode=1)
698
self.runbzr('remerge', retcode=3)
701
701
def test_conflicts(self):
721
721
self.runbzr('resolve hello')
722
722
result = self.runbzr('conflicts', backtick=1)
723
723
self.assertEquals(result, "question\n")
724
self.runbzr('commit -m conflicts', retcode=1)
724
self.runbzr('commit -m conflicts', retcode=3)
725
725
self.runbzr('resolve --all')
726
726
result = self.runbzr('conflicts', backtick=1)
727
727
self.runbzr('commit -m conflicts')
771
771
self.example_branch()
773
773
# with no push target, fail
774
self.runbzr('push', retcode=1)
774
self.runbzr('push', retcode=3)
775
775
# with an explicit target work
776
776
self.runbzr('push ../output-branch')
777
777
# with an implicit target work
791
791
self.runbzr('commit --unchanged -m unchanged')
792
792
os.chdir('../my-branch')
793
793
# cannot push now
794
self.runbzr('push', retcode=1)
794
self.runbzr('push', retcode=3)
795
795
# and there are difference
796
796
self.runbzr('missing ../output-branch', retcode=1)
797
797
# but we can force a push
800
800
self.runbzr('missing ../output-branch')
802
802
# pushing to a new dir with no parent should fail
803
self.runbzr('push ../missing/new-branch', retcode=1)
803
self.runbzr('push ../missing/new-branch', retcode=3)
804
804
# unless we provide --create-prefix
805
805
self.runbzr('push --create-prefix ../missing/new-branch')
806
806
# nothing missing
872
872
runbzr("help st")
874
874
runbzr("help commands")
875
runbzr("help slartibartfast", 1)
875
runbzr("help slartibartfast", 3)
877
877
out = capture("help ci")
878
878
out.index('aliases: ')
880
880
progress("can't rename unversioned file")
881
runbzr("rename test.txt new-test.txt", 1)
881
runbzr("rename test.txt new-test.txt", 3)
883
883
progress("adding a file")
899
899
progress("more complex renames")
901
runbzr("rename hello.txt sub1", 1)
902
runbzr("rename hello.txt sub1/hello.txt", 1)
903
runbzr("move hello.txt sub1", 1)
901
runbzr("rename hello.txt sub1", 3)
902
runbzr("rename hello.txt sub1/hello.txt", 3)
903
runbzr("move hello.txt sub1", 3)
905
905
runbzr("add sub1")
906
906
runbzr("rename sub1 sub2")
960
960
runbzr('log -v --forward')
961
runbzr('log -m', retcode=1)
961
runbzr('log -m', retcode=3)
962
962
log_out = capture('log -m commit')
963
963
self.assert_("this is my new commit\n and" in log_out)
964
964
self.assert_("rename nested" not in log_out)