File: nodeps.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 (81 lines) | stat: -rw-r--r-- 1,912 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
set -ev

# Test the --no-deps option with Send, Push, Pull, Obliterate and Unrecord.
#
# Create four patches with dependencies.
#   file 'f': patch 'fa' and 'fb'
#   file 'g': patch 'ga' and 'gb'
# The 'b' patches depend on the 'a' patches.

rm -rf tmp1
mkdir tmp1
cd tmp1
darcs init
echo 'record no-ask-deps' >> _darcs/prefs/defaults
echo 'record ignore-times' >> _darcs/prefs/defaults
echo 'a' > f
darcs add f
darcs rec -am 'fa' f
echo 'a' > g
darcs add g
darcs rec -am 'ga' g
echo 'b' > f
darcs rec -am 'fb' f
echo 'b' > g
darcs rec -am 'gb' g


mkdir d
darcs init --repodir d


# Try to Send all 'b' and 'g' patches. The two 'g' patches should succeed,
# but the 'fb' patch depends on the unselected 'fa' patch, an should be
# skipped.

darcs send -o bundle -a -p '[bg]' --no-deps d
grep '^\[ga$' bundle
grep '^\[fb$' bundle && exit 1


# Try to Push all 'b' and 'g' patches. Expect same result as for Send.

darcs push -a -p '[bg]' --no-deps d
cd d
darcs changes | grep '^  \* ga$'
darcs changes | grep '^  \* fb$' && exit 1
# stay in d !!


# Try to Pull all 'b' and 'g' patches. Expect same result as for Send.

# already in d
rm -rf *; darcs init
darcs pull -a -p '[bg]' --no-deps ..
darcs changes | grep '^  \* ga$'
darcs changes | grep '^  \* fb$' && exit 1
cd ..


# Try to Obliterate all 'a' and 'g' patches. The two 'g' patches should
# succeed, but the 'fa' patch depends on the unselected 'fb' patch, an
# should be skipped.

darcs get . tmp; cd tmp
echo y/y/y/q | tr / \\012 | darcs obliterate -p '[ag]' --no-deps
darcs changes | grep '^  \* gb$' && exit 1
darcs changes | grep '^  \* fa$'
cd ..


# Try to Unrecord all 'a' and 'g' patches. Expect same result as for
# Obliterate.

# in "top" tmp repo -- destroys it!
echo y/y/y/q | tr / \\012 | darcs unrecord -p '[ag]' --no-deps
darcs changes | grep '^  \* gb$' && exit 1
darcs changes | grep '^  \* fa$'

cd ..
rm -rf tmp1