Merge branch 'darcs' into master
[git-darcs-import.git] / tests / changes.sh
blob1adf1db1f5b27b802c5056134a326b4e38c6e90e
1 #!/usr/bin/env bash
2 set -ev
4 # Some tests for 'darcs changes'
6 rm -rf temp1
7 mkdir temp1
8 cd temp1
9 darcs init
11 date >> date.t
12 darcs add date.t
14 darcs record -A 'Mark Stosberg <a@b.com>' -a -m foo date.t
16 ####
18 darcs changes date.t > out # trivial case first
19 cat out
20 grep foo out
22 darcs changes --last=1 date.t > out
23 cat out
24 grep foo out
26 darcs changes --last 1 --summary date.t > out
27 cat out
28 grep foo out
30 darcs changes --last=1 --xml > out
31 cat out
32 grep '&lt;a@b.com&gt;' out # check that --xml encodes < and >
34 ###
36 # Add 6 records and try again
37 for i in 0 1 2 3 4 5; do
38 date >> date.t
39 darcs record -a -m "foo record num $i" date.t
40 done
42 darcs changes date.t > out
43 cat out
44 grep foo out
46 darcs changes --last=1 date.t > out
47 cat out
48 grep foo out
50 darcs changes --last 1 --summary date.t > out
51 cat out
52 grep foo out
54 ###
56 darcs changes --context --from-patch='num 1' --to-patch 'num 4' > out
57 cat out
58 grep 'num 4' out
59 grep 'num 3' out
60 grep 'num 2' out
61 grep 'num 1' out
63 ###
65 date >> second_file.t
66 darcs add second_file.t
68 darcs record -a -m adding_second_file second_file.t
70 cd ..
71 rm -rf temp1