Merge branch 'darcs' into master
[git-darcs-import.git] / tests / issue381.sh
blob7936f7a60ff1f6353ab28214782c7144d1968c64
1 #!/usr/bin/env bash
2 set -ev
4 # for issue381: "darcs send -o message --edit-description doesn't work"
6 DARCS_EDITOR=echo
7 export DARCS_EDITOR
9 rm -rf temp1 temp2
10 mkdir temp1 temp2
12 cd temp2
13 darcs init
14 cd ..
16 cd temp1
17 darcs init
18 echo Hello world > foobar
19 darcs add foobar
20 darcs record -a -A me -m add_foobar
22 # Test that editor is called when --output is used with --edit-description
23 echo This is a note > note
24 cat > editor <<EOF
25 #!/usr/bin/env bash
26 echo I am running the editor
27 echo the file is \$1
28 mv \$1 \$1-temp
29 echo hello world >> \$1
30 cat \$1-temp >> \$1
31 echo >> \$1
32 echo finished editing >> \$1
33 echo I am done running the editor
34 EOF
36 chmod +x editor
38 DARCS_EDITOR='bash editor' darcs send --debug --author=me -a --output=bundle --edit-description ../temp2
40 echo === beginning of bundle > ===
41 cat bundle
42 echo === end of bundle > ===
44 grep ' add_foobar' bundle
45 grep 'finished editing' bundle
47 IFS=' ' darcs send --author=me -a --subject="it works" --to user@place.org --sendmail-command='grep "^Subject: it works$" %<' ../temp2
49 cd ..
50 rm -rf temp1 temp2