Follow upstream changes -- rest
[git-darcs-import.git] / tests / ask_deps.sh
blob6fa1a251d34f3e98d64c501711168e9f9008c320
1 #!/usr/bin/env bash
2 set -ev
4 rm -rf temp
5 mkdir temp
6 cd temp
8 darcs init
9 cat > _darcs/prefs/defaults <<.
10 ALL author test
11 ALL ignore-times
12 ALL ask-deps
15 # add three depending patches for file 'a'
16 # expect no dependency questions
17 # 'q' will abort and cause future failure if an unexpected dependency is asked
18 touch a
19 darcs add a
20 echo q | darcs rec -am a0
21 darcs ann -p a0
22 echo 1 > a
23 echo q | darcs rec -am a1
24 darcs ann -p a1
25 echo 2 > a
26 echo q | darcs rec -am a2
27 darcs ann -p a2
29 # add some patches for file 'b'
30 # expect no dependency questions for file 'b',
31 # but every time expect questions for the three patches of file 'a'
32 # every 'n' should continue to ask about the next patch
33 # the first 'y' should make all following dependencies of 'a' implicit and stop asking
34 # 'q' will abort and cause future failure if an unexpected dependency is asked
35 touch b
36 darcs add b
37 # test 0
38 echo n/n/n/q | tr / \\012 | darcs rec -am b0
39 darcs ann -p b0
40 # test 1
41 echo 1 > b
42 echo n/n/y/q | tr / \\012 | darcs rec -am b1
43 darcs ann -p b1 | grep '^\[a0'
44 # test 2
45 echo 2 > b
46 echo n/y/q | tr / \\012 | darcs rec -am b2
47 darcs ann -p b2 | grep '^\[a1'
48 # test 3
49 echo 3 > b
50 echo y/q | tr / \\012 | darcs rec -am b3
51 darcs ann -p b3 | grep '^\[a2'
53 cd ..
54 rm -rf temp