annotate tests/test-mq-qrefresh-replace-log-message.t @ 21930:a5168eb9b2bc stable

tests: cat error messages are different on Solaris
author Danek Duvall <danek.duvall@oracle.com>
date Mon, 21 Jul 2014 11:27:24 -0700
parents 5375ba75df40
children de5cee8ba088
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17478
113d0a3d050b spelling: Environment
timeless@mozdev.org
parents: 12468
diff changeset
1 Environment setup for MQ
2694
0fb28dbf0dc7 MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff changeset
2
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
3 $ echo "[extensions]" >> $HGRCPATH
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
4 $ echo "mq=" >> $HGRCPATH
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
5 $ hg init
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
6 $ hg qinit
2694
0fb28dbf0dc7 MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff changeset
7
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
8 Should fail if no patches applied
21423
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
9 (this tests also that editor is not invoked if '--edit' is not
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
10 specified)
2694
0fb28dbf0dc7 MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff changeset
11
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
12 $ hg qrefresh
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
13 no patches applied
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
14 [1]
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
15 $ hg qrefresh -e
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
16 no patches applied
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
17 [1]
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
18 $ hg qnew -m "First commit message" first-patch
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
19 $ echo aaaa > file
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
20 $ hg add file
21423
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
21 $ HGEDITOR=cat hg qrefresh
5334
448eb46d4d84 mq: fix qrefresh -e with no patches applied
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4659
diff changeset
22
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
23 Should display 'First commit message'
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
24
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
25 $ hg log -l1 --template "{desc}\n"
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
26 First commit message
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
27
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
28 Testing changing message with -m
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
29 (this tests also that '--edit' can be used with '--message', and
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
30 that '[committemplate] changeset' definition and commit log specific
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
31 template keyword 'extramsg' work well)
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
32
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
33 $ cat >> .hg/hgrc <<EOF
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
34 > [committemplate]
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
35 > changeset = HG: this is customized commit template
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
36 > {desc}\n\n
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
37 > HG: Enter commit message. Lines beginning with 'HG:' are removed.
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
38 > HG: {extramsg}
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
39 > HG: --
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
40 > HG: user: {author}
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
41 > HG: branch '{branch}'\n{file_adds %
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
42 > "HG: added {file}\n" }{file_mods %
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
43 > "HG: changed {file}\n" }{file_dels %
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
44 > "HG: removed {file}\n" }{if(files, "",
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
45 > "HG: no files changed\n")}
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
46 > EOF
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
47
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
48 $ echo bbbb > file
21713
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
49 $ HGEDITOR=cat hg qrefresh -m "Second commit message" -e
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
50 HG: this is customized commit template
21713
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
51 Second commit message
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
52
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
53
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
54 HG: Enter commit message. Lines beginning with 'HG:' are removed.
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
55 HG: Leave message empty to use default message.
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
56 HG: --
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
57 HG: user: test
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
58 HG: branch 'default'
7a51bced398b qrefresh: allow to specify '--message/'--logfile' and '--edit' at the same time
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21423
diff changeset
59 HG: added file
2694
0fb28dbf0dc7 MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff changeset
60
21924
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
61 $ cat >> .hg/hgrc <<EOF
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
62 > # disable customizing for subsequent tests
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
63 > [committemplate]
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
64 > changeset =
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
65 > EOF
5375ba75df40 cmdutil: make commit message shown in text editor customizable by template
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21713
diff changeset
66
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
67 Should display 'Second commit message'
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
68
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
69 $ hg log -l1 --template "{desc}\n"
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
70 Second commit message
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
71
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
72 Testing changing message with -l
2694
0fb28dbf0dc7 MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff changeset
73
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
74 $ echo "Third commit message" > logfile
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
75 $ echo " This is the 3rd log message" >> logfile
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
76 $ echo bbbb > file
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
77 $ hg qrefresh -l logfile
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
78
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
79 Should display 'Third commit message\\\n This is the 3rd log message'
2694
0fb28dbf0dc7 MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff changeset
80
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
81 $ hg log -l1 --template "{desc}\n"
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
82 Third commit message
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
83 This is the 3rd log message
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
84
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
85 Testing changing message with -l-
2694
0fb28dbf0dc7 MQ: uniformise message and logfile option.
"Mathieu Clabaut <mathieu.clabaut@gmail.com>"
parents:
diff changeset
86
12468
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
87 $ hg qnew -m "First commit message" second-patch
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
88 $ echo aaaa > file2
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
89 $ hg add file2
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
90 $ echo bbbb > file2
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
91 $ (echo "Fifth commit message"; echo " This is the 5th log message") | hg qrefresh -l-
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
92
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
93 Should display 'Fifth commit message\\\n This is the 5th log message'
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
94
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
95 $ hg log -l1 --template "{desc}\n"
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
96 Fifth commit message
d8bf747d2e29 tests: unify test-mq-qrefresh-replace-log-message
Matt Mackall <mpm@selenic.com>
parents: 5334
diff changeset
97 This is the 5th log message
21236
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
98
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
99 Test saving last-message.txt:
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
100
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
101 $ cat > $TESTTMP/editor.sh << EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
102 > echo "==== before editing"
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
103 > cat \$1
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
104 > echo "===="
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
105 > (echo; echo "test saving last-message.txt") >> \$1
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
106 > EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
107
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
108 $ cat > $TESTTMP/commitfailure.py <<EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
109 > from mercurial import util
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
110 > def reposetup(ui, repo):
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
111 > class commitfailure(repo.__class__):
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
112 > def commit(self, *args, **kwargs):
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
113 > raise util.Abort('emulating unexpected abort')
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
114 > repo.__class__ = commitfailure
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
115 > EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
116
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
117 $ cat >> .hg/hgrc <<EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
118 > [extensions]
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
119 > # this failure occurs before editor invocation
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
120 > commitfailure = $TESTTMP/commitfailure.py
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
121 > EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
122
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
123 $ hg qapplied
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
124 first-patch
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
125 second-patch
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
126 $ hg tip --template "{files}\n"
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
127 file2
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
128
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
129 (test that editor is not invoked before transaction starting)
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
130
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
131 $ rm -f .hg/last-message.txt
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
132 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qrefresh -e
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
133 refresh interrupted while patch was popped! (revert --all, qpush to recover)
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
134 abort: emulating unexpected abort
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
135 [255]
21930
a5168eb9b2bc tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents: 21924
diff changeset
136 $ test -f .hg/last-message.txt
21236
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
137 [1]
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
138
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
139 (reset applied patches and directory status)
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
140
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
141 $ cat >> .hg/hgrc <<EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
142 > [extensions]
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
143 > commitfailure = !
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
144 > EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
145
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
146 $ hg qapplied
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
147 first-patch
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
148 $ hg status -A file2
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
149 ? file2
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
150 $ rm file2
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
151 $ hg qpush -q second-patch
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
152 now at: second-patch
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
153
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
154 (test that editor is invoked and commit message is saved into
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
155 "last-message.txt")
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
156
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
157 $ cat >> .hg/hgrc <<EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
158 > [hooks]
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
159 > # this failure occurs after editor invocation
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
160 > pretxncommit.unexpectedabort = false
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
161 > EOF
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
162
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
163 $ rm -f .hg/last-message.txt
21423
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
164 $ hg status --rev "second-patch^1" -arm
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
165 A file2
21236
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
166 $ HGEDITOR="sh $TESTTMP/editor.sh" hg qrefresh -e
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
167 ==== before editing
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
168 Fifth commit message
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
169 This is the 5th log message
21423
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
170
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
171
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
172 HG: Enter commit message. Lines beginning with 'HG:' are removed.
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
173 HG: Leave message empty to use default message.
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
174 HG: --
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
175 HG: user: test
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
176 HG: branch 'default'
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
177 HG: added file2
21236
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
178 ====
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
179 transaction abort!
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
180 rollback completed
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
181 note: commit message saved in .hg/last-message.txt
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
182 refresh interrupted while patch was popped! (revert --all, qpush to recover)
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
183 abort: pretxncommit.unexpectedabort hook exited with status 1
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
184 [255]
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
185 $ cat .hg/last-message.txt
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
186 Fifth commit message
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
187 This is the 5th log message
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
188
21423
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
189
7d408720453d mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qrefresh/qfold)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21236
diff changeset
190
21236
49148d7868df qrefresh: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17478
diff changeset
191 test saving last-message.txt