File: ask_deps.sh

package info (click to toggle)
darcs 2.0.2-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,400 kB
  • ctags: 1,048
  • sloc: haskell: 24,937; perl: 9,736; sh: 3,369; ansic: 1,913; makefile: 17; xml: 14
file content (55 lines) | stat: -rw-r--r-- 1,238 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
set -ev

rm -rf temp
mkdir temp
cd temp

darcs init
cat > _darcs/prefs/defaults <<.
ALL author test
ALL ignore-times
ALL ask-deps
.

# add three depending patches for file 'a'
# expect no dependency questions
# 'q' will abort and cause future failure if an unexpected dependency is asked
touch a
darcs add a
echo q | darcs rec -am a0
darcs ann -p a0
echo 1 > a
echo q | darcs rec -am a1
darcs ann -p a1
echo 2 > a
echo q | darcs rec -am a2
darcs ann -p a2

# add some patches for file 'b'
# expect no dependency questions for file 'b',
# but every time expect questions for the three patches of file 'a'
# every 'n' should continue to ask about the next patch
# the first 'y' should make all following dependencies of 'a' implicit and stop asking
# 'q' will abort and cause future failure if an unexpected dependency is asked
touch b
darcs add b
# test 0
echo n/n/n/q | tr / \\012 | darcs rec -am b0
darcs ann -p b0
# test 1
echo 1 > b
echo n/n/y/q | tr / \\012 | darcs rec -am b1
darcs ann -p b1 | grep '^\[a0'
# test 2
echo 2 > b
echo n/y/q | tr / \\012 | darcs rec -am b2
darcs ann -p b2 | grep '^\[a1'
# test 3
echo 3 > b
echo y/q | tr / \\012 | darcs rec -am b3
darcs ann -p b3 | grep '^\[a2'

cd ..
rm -rf temp