File: record_editor.sh

package info (click to toggle)
darcs 2.4.4-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,292 kB
  • ctags: 259
  • sloc: haskell: 26,818; sh: 7,051; ansic: 1,572; perl: 124; makefile: 24
file content (59 lines) | stat: -rw-r--r-- 1,117 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
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bash

# Some tests for 'darcs rec --edit-long-comment'

. lib

abort_windows

rm -rf temp1

export DARCS_EDITOR="/bin/cat -n"
# editor: space in command
mkdir temp1
cd temp1
darcs init
touch file.t
darcs add file.t
echo y | darcs record --edit-long-comment -a -m foo file.t | grep '2.*END OF DESCRIPTION'
cd ..
rm -rf temp1

# editor: space in path
mkdir temp2\ dir
cd temp2\ dir
darcs init
touch file.t
darcs add file.t
echo y | darcs record --edit-long-comment -a -m foo file.t | grep '2.*END OF DESCRIPTION'
cd ..
rm -rf temp2\ dir

export DARCS_EDITOR='grep "END OF"'
# editor: quoting in command
mkdir temp1
cd temp1
darcs init
touch file.t
darcs add file.t
echo y | darcs record --edit-long-comment -a -m foo file.t | grep 'END OF'
cd ..
rm -rf temp1

export DARCS_EDITOR='/bin/echo'
# editor: evil filename
mkdir temp1
cd temp1
darcs init
touch file.t
darcs add file.t
touch '; test-command'
echo > test-command << FOO
#!/bin/sh
echo EVIL
FOO
chmod u+x test-command
echo y | darcs record --logfile='; test-command' --edit-long-comment -a -m foo file.t > log
not grep EVIL log
cd ..
rm -rf temp1