Follow upstream changes -- rest
[git-darcs-import.git] / tests / pending_has_conflicts.sh
blobf743833c3bb3f3c65ba7464637b3a083ca58447a
1 #!/usr/bin/env bash
2 set -ev
4 ## I would use the builtin !, but that has the wrong semantics.
5 not () { "$@" && exit 1 || :; }
7 rm -rf temp1
8 mkdir temp1
9 cd temp1
10 darcs init
12 date > date.t
13 date > date_moved.t
15 write_buggy_pending () {
16 cat > _darcs/patches/pending <<EOF
18 addfile ./date.t
19 addfile ./date_moved.t
20 move ./date.t ./date_moved.t
22 EOF
24 write_buggy_pending
26 echo now watch the fireworks as all sorts of things fail
27 not darcs whatsnew &> out
28 cat out
29 grep 'pending has conflicts' out
31 echo pending should now be fixed but there are no changes
32 not darcs whatsnew
34 write_buggy_pending
36 darcs revert -a &> out
37 cat out
38 grep 'pending has conflicts' out
40 echo pending should now be emptied
41 darcs revert -a
43 write_buggy_pending
45 darcs record -a -m foo &> out
46 cat out
47 grep 'pending has conflicts' out
49 darcs record -a -m foo
51 darcs changes -v
53 darcs repair &> out
54 cat out
55 grep 'The repository is already consistent' out
57 write_buggy_pending
59 darcs repair &> out
60 cat out
61 grep 'The repository is already consistent' out
63 cd ..
64 rm -rf temp1