3
# Simple shell-based tests for bzr.
 
 
5
# This is meant to exercise the external behaviour, command line
 
 
6
# parsing and similar things and compliment the inwardly-turned
 
 
7
# testing done by doctest.
 
 
9
# This must already exist and be in the right place
 
 
10
if ! [ -d bzr-test.tmp ] 
 
 
12
    echo "please create bzr-test.tmp"
 
 
19
# save it for real errors
 
 
27
    echo "tests failed, look in bzr-test.log" >&3; exit 2; 
 
 
35
# some information commands
 
 
39
# invalid commands are detected
 
 
42
# some experiments with renames
 
 
44
echo "hello world" > test.txt
 
 
47
# should be the only unknown file
 
 
48
[ "`bzr unknowns`" = test.txt ]
 
 
50
# can't rename unversioned files; use the regular unix rename command
 
 
51
! bzr rename test.txt new-test.txt
 
 
53
# ok, so now add it and see what happens
 
 
55
[ -z "`bzr unknowns`" ]
 
 
57
# after adding even before committing you can rename files
 
 
58
bzr rename test.txt newname.txt
 
 
59
[ "`bzr status`" = "A       newname.txt" ]
 
 
62
bzr commit -m "add first revision"
 
 
65
# now more complicated renames
 
 
67
! bzr rename newname.txt sub1
 
 
68
! bzr rename newname.txt sub1/foo.txt
 
 
70
! bzr rename newname.txt sub1
 
 
72
bzr rename newname.txt sub1/foo.txt
 
 
76
bzr rename sub1/foo.txt newname.txt
 
 
79
bzr rename newname.txt sub1/foo.txt
 
 
80
bzr rename sub1/foo.txt sub1/bar.txt
 
 
85
bzr rename bar.txt sub2/bar.txt
 
 
87
bzr rename bar.txt ../../bar.txt
 
 
90
bzr commit -m "more renames"
 
 
93
# now try pulling that file back out, checking it was stored properly
 
 
94
[ "`bzr cat -r 1 newname.txt`" = "hello world" ]
 
 
96
! bzr rename sub1 sub1/knotted-up