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