##// END OF EJS Templates
test-editor-filename: fix portability of fake editor command...
Yuya Nishihara -
r34060:4bf18894 default
parent child Browse files
Show More
@@ -1,63 +1,61 b''
1 Test temp file used with an editor has the expected suffix.
1 Test temp file used with an editor has the expected suffix.
2
2
3 $ hg init
3 $ hg init
4
4
5 Create an editor that writes its arguments to stdout and set it to $HGEDITOR.
5 Create an editor that writes its arguments to stdout and set it to $HGEDITOR.
6
6
7 $ cat > editor.sh << EOF
7 $ cat > editor.sh << EOF
8 > #!/bin/bash
9 > echo "\$@"
8 > echo "\$@"
10 > exit 1
9 > exit 1
11 > EOF
10 > EOF
12 $ chmod +x editor.sh
13 $ hg add editor.sh
11 $ hg add editor.sh
14 $ HGEDITOR=$TESTTMP/editor.sh
12 $ HGEDITOR="sh $TESTTMP/editor.sh"
15 $ export HGEDITOR
13 $ export HGEDITOR
16
14
17 Verify that the path for a commit editor has the expected suffix.
15 Verify that the path for a commit editor has the expected suffix.
18
16
19 $ hg commit
17 $ hg commit
20 *.commit.hg.txt (glob)
18 *.commit.hg.txt (glob)
21 abort: edit failed: editor.sh exited with status 1
19 abort: edit failed: sh exited with status 1
22 [255]
20 [255]
23
21
24 Verify that the path for a histedit editor has the expected suffix.
22 Verify that the path for a histedit editor has the expected suffix.
25
23
26 $ cat >> $HGRCPATH <<EOF
24 $ cat >> $HGRCPATH <<EOF
27 > [extensions]
25 > [extensions]
28 > rebase=
26 > rebase=
29 > histedit=
27 > histedit=
30 > EOF
28 > EOF
31 $ hg commit --message 'At least one commit for histedit.'
29 $ hg commit --message 'At least one commit for histedit.'
32 $ hg histedit
30 $ hg histedit
33 *.histedit.hg.txt (glob)
31 *.histedit.hg.txt (glob)
34 abort: edit failed: editor.sh exited with status 1
32 abort: edit failed: sh exited with status 1
35 [255]
33 [255]
36
34
37 Verify that when performing an action that has the side-effect of creating an
35 Verify that when performing an action that has the side-effect of creating an
38 editor for a diff, the file ends in .diff.
36 editor for a diff, the file ends in .diff.
39
37
40 $ echo 1 > one
38 $ echo 1 > one
41 $ echo 2 > two
39 $ echo 2 > two
42 $ hg add
40 $ hg add
43 adding one
41 adding one
44 adding two
42 adding two
45 $ hg commit --interactive --config ui.interactive=true --config ui.interface=text << EOF
43 $ hg commit --interactive --config ui.interactive=true --config ui.interface=text << EOF
46 > y
44 > y
47 > e
45 > e
48 > q
46 > q
49 > EOF
47 > EOF
50 diff --git a/one b/one
48 diff --git a/one b/one
51 new file mode 100644
49 new file mode 100644
52 examine changes to 'one'? [Ynesfdaq?] y
50 examine changes to 'one'? [Ynesfdaq?] y
53
51
54 @@ -0,0 +1,1 @@
52 @@ -0,0 +1,1 @@
55 +1
53 +1
56 record change 1/2 to 'one'? [Ynesfdaq?] e
54 record change 1/2 to 'one'? [Ynesfdaq?] e
57
55
58 *.diff (glob)
56 *.diff (glob)
59 editor exited with exit code 1
57 editor exited with exit code 1
60 record change 1/2 to 'one'? [Ynesfdaq?] q
58 record change 1/2 to 'one'? [Ynesfdaq?] q
61
59
62 abort: user quit
60 abort: user quit
63 [255]
61 [255]
General Comments 0
You need to be logged in to leave comments. Login now