Follow upstream changes -- Bytestring updates
[git-darcs-import.git] / tests / issue1039.sh
blobc4a5e5d3413170b2265ac6c6226e93553e74e947
1 #!/usr/bin/env bash
3 set -ev
5 # The builtin ! has the wrong semantics for not.
6 not () { "$@" && exit 1 || :; }
8 # pull from not empty repo to empty repo
9 rm -rf temp1 temp2
10 mkdir temp1 temp2
12 cd temp1
13 darcs init
14 echo a > a
15 darcs add a
16 darcs record --all --patch-name=a
17 cd ../temp2
18 darcs init
19 darcs pull --all --dont-allow-conflicts ../temp1
20 test `darcs changes --count` = "1"
21 cd ..
23 # push from not empty repo to empty repo
24 rm -rf temp1 temp2
25 mkdir temp1 temp2
27 cd temp1
28 darcs init
29 cd ../temp2
30 darcs init
31 echo a > a
32 darcs add a
33 darcs record --all --patch-name=a
34 darcs push --all ../temp1
35 cd ../temp1
36 test `darcs changes --count` = "1"
37 cd ..
39 # send from not empty repo to not empty repo
40 rm -rf temp1 temp2
41 mkdir temp1 temp2
43 cd temp1
44 darcs init
45 echo a > a
46 darcs add a
47 darcs record --all --patch-name=a
49 for i in 1 2 3 4 5 6 7 8 9; do
50 echo Change number $i >> a
51 darcs record -a -m "change a $i"
52 done
54 cd ../temp2
55 darcs init
56 echo b > b
57 darcs add b
58 darcs record --all --patch-name=b
60 for i in 1 2 3 4 5 6 7 8 9; do
61 echo Change number $i >> b
62 darcs record -a -m "change b $i"
63 done
65 echo no | darcs send --all --to=random@random --sendmail-command=false ../temp1
66 echo yes | not darcs send --all --to=random@random --sendmail-command=false ../temp1
67 not darcs send --all --to=random@random --sendmail-command=false --allow-unrelated-repos ../temp1
68 cd ..
70 rm -rf temp1 temp2