File: issue381.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 (50 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download
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
#!/usr/bin/env bash
set -ev

# for issue381: "darcs send -o message --edit-description doesn't work"

DARCS_EDITOR=echo
export DARCS_EDITOR

rm -rf temp1 temp2
mkdir temp1 temp2

cd temp2
darcs init
cd ..

cd temp1
darcs init
echo Hello world > foobar
darcs add foobar
darcs record -a -A me -m add_foobar

# Test that editor is called when --output is used with --edit-description
echo This is a note > note
cat > editor <<EOF
#!/usr/bin/env bash
echo I am running the editor
echo the file is \$1
mv \$1 \$1-temp
echo hello world >> \$1
cat \$1-temp >> \$1
echo >> \$1
echo finished editing >> \$1
echo I am done running the editor
EOF

chmod +x editor

DARCS_EDITOR='bash editor' darcs send --debug --author=me -a --output=bundle --edit-description ../temp2

echo === beginning of bundle > ===
cat bundle
echo === end of bundle > ===

grep ' add_foobar' bundle
grep 'finished editing' bundle

IFS=' ' darcs send --author=me -a --subject="it works" --to user@place.org --sendmail-command='grep "^Subject: it works$" %<' ../temp2

cd ..
rm -rf temp1 temp2