author | Michael Bolin <mbolin@fb.com> |
Wed, 30 Aug 2017 20:25:56 +0000 | |
changeset 34046 | 6e6452bc441d |
child 34071 | 3c82b14d2838 |
permissions | -rw-r--r-- |
34046
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
1 |
Test temp file used with an editor has the expected suffix. |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
2 |
|
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
3 |
$ hg init |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
4 |
|
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
5 |
Create an editor that writes its arguments to stdout and set it to $HGEDITOR. |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
6 |
|
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
7 |
$ cat > editor.sh << EOF |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
8 |
> #!/bin/bash |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
9 |
> echo "\$@" |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
10 |
> exit 1 |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
11 |
> EOF |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
12 |
$ chmod +x editor.sh |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
13 |
$ hg add editor.sh |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
14 |
$ HGEDITOR=$TESTTMP/editor.sh |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
15 |
$ export HGEDITOR |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
16 |
|
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
17 |
Verify that the path for a commit editor has the expected suffix. |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
18 |
|
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
19 |
$ hg commit |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
20 |
*.commit.hg.txt (glob) |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
21 |
abort: edit failed: editor.sh exited with status 1 |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
22 |
[255] |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
23 |
|
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
24 |
Verify that the path for a histedit editor has the expected suffix. |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
25 |
|
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
26 |
$ cat >> $HGRCPATH <<EOF |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
27 |
> [extensions] |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
28 |
> rebase= |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
29 |
> histedit= |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
30 |
> EOF |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
31 |
$ hg commit --message 'At least one commit for histedit.' |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
32 |
$ hg histedit |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
33 |
*.histedit.hg.txt (glob) |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
34 |
abort: edit failed: editor.sh exited with status 1 |
6e6452bc441d
editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com>
parents:
diff
changeset
|
35 |
[255] |