author | Kyle Lippincott <spectral@google.com> |
Mon, 08 Jul 2019 13:06:46 -0700 | |
changeset 42572 | cd4f1b7c3192 |
parent 42532 | 12243f15d53e |
child 42597 | 51e52a495214 |
permissions | -rw-r--r-- |
7296
695383442347
mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
1 |
|
12466 | 2 |
$ catpatch() { |
3 |
> cat $1 | sed -e "s/^\(# Parent \).*/\1/" |
|
4 |
> } |
|
5 |
$ echo "[extensions]" >> $HGRCPATH |
|
6 |
$ echo "mq=" >> $HGRCPATH |
|
7 |
$ runtest() { |
|
8 |
> hg init mq |
|
9 |
> cd mq |
|
10 |
> |
|
11 |
> echo a > a |
|
12 |
> hg ci -Ama |
|
13 |
> |
|
14 |
> echo '% qnew should refuse bad patch names' |
|
15 |
> hg qnew series |
|
16 |
> hg qnew status |
|
17 |
> hg qnew guards |
|
14051
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
18 |
> hg qnew . |
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
19 |
> hg qnew .. |
12466 | 20 |
> hg qnew .hgignore |
21 |
> hg qnew .mqfoo |
|
22 |
> hg qnew 'foo#bar' |
|
23 |
> hg qnew 'foo:bar' |
|
25454
b5a8bc09b0db
mq: ban \r and \n in patch names (issue4711)
Augie Fackler <augie@google.com>
parents:
25453
diff
changeset
|
24 |
> hg qnew "`echo foo; echo bar`" |
31556
448acdee9161
mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents:
26998
diff
changeset
|
25 |
> hg qnew ' foo' |
448acdee9161
mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents:
26998
diff
changeset
|
26 |
> hg qnew 'foo ' |
12466 | 27 |
> |
28 |
> hg qinit -c |
|
29 |
> |
|
30 |
> echo '% qnew with name containing slash' |
|
12878
1634287b6ab1
qnew: give better feedback when doing 'hg qnew foo/' (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12466
diff
changeset
|
31 |
> hg qnew foo/ |
12466 | 32 |
> hg qnew foo/bar.patch |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
33 |
> hg qnew foo |
12466 | 34 |
> hg qseries |
35 |
> hg qpop |
|
36 |
> hg qdelete foo/bar.patch |
|
37 |
> |
|
38 |
> echo '% qnew with uncommitted changes' |
|
39 |
> echo a > somefile |
|
40 |
> hg add somefile |
|
41 |
> hg qnew uncommitted.patch |
|
42 |
> hg st |
|
43 |
> hg qseries |
|
44 |
> |
|
45 |
> echo '% qnew implies add' |
|
46 |
> hg -R .hg/patches st |
|
47 |
> |
|
48 |
> echo '% qnew missing' |
|
49 |
> hg qnew missing.patch missing |
|
50 |
> |
|
51 |
> echo '% qnew -m' |
|
52 |
> hg qnew -m 'foo bar' mtest.patch |
|
53 |
> catpatch .hg/patches/mtest.patch |
|
54 |
> |
|
55 |
> echo '% qnew twice' |
|
56 |
> hg qnew first.patch |
|
57 |
> hg qnew first.patch |
|
58 |
> |
|
59 |
> touch ../first.patch |
|
60 |
> hg qimport ../first.patch |
|
61 |
> |
|
62 |
> echo '% qnew -f from a subdirectory' |
|
63 |
> hg qpop -a |
|
64 |
> mkdir d |
|
65 |
> cd d |
|
66 |
> echo b > b |
|
67 |
> hg ci -Am t |
|
68 |
> echo b >> b |
|
69 |
> hg st |
|
70 |
> hg qnew -g -f p |
|
71 |
> catpatch ../.hg/patches/p |
|
72 |
> |
|
73 |
> echo '% qnew -u with no username configured' |
|
74 |
> HGUSER= hg qnew -u blue red |
|
75 |
> catpatch ../.hg/patches/red |
|
76 |
> |
|
77 |
> echo '% qnew -e -u with no username configured' |
|
78 |
> HGUSER= hg qnew -e -u chartreuse fucsia |
|
79 |
> catpatch ../.hg/patches/fucsia |
|
80 |
> |
|
81 |
> echo '% fail when trying to import a merge' |
|
82 |
> hg init merge |
|
83 |
> cd merge |
|
84 |
> touch a |
|
85 |
> hg ci -Am null |
|
86 |
> echo a >> a |
|
87 |
> hg ci -m a |
|
88 |
> hg up -r 0 |
|
89 |
> echo b >> a |
|
90 |
> hg ci -m b |
|
91 |
> hg merge -f 1 |
|
92 |
> hg resolve --mark a |
|
93 |
> hg qnew -f merge |
|
94 |
> |
|
95 |
> cd ../../.. |
|
96 |
> rm -r mq |
|
97 |
> } |
|
10397
8cb81d75730c
mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents:
10372
diff
changeset
|
98 |
|
12466 | 99 |
plain headers |
7296
695383442347
mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
100 |
|
12466 | 101 |
$ echo "[mq]" >> $HGRCPATH |
102 |
$ echo "plain=true" >> $HGRCPATH |
|
103 |
$ mkdir sandbox |
|
104 |
$ (cd sandbox ; runtest) |
|
105 |
adding a |
|
106 |
% qnew should refuse bad patch names |
|
107 |
abort: "series" cannot be used as the name of a patch |
|
108 |
abort: "status" cannot be used as the name of a patch |
|
109 |
abort: "guards" cannot be used as the name of a patch |
|
14051
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
110 |
abort: "." cannot be used as the name of a patch |
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
111 |
abort: ".." cannot be used as the name of a patch |
14054
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
112 |
abort: patch name cannot begin with ".hg" |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
113 |
abort: patch name cannot begin with ".mq" |
25453
d3a00fc3680f
mq: use %r to format illegal characters instead of manually quoting
Augie Fackler <augie@google.com>
parents:
22521
diff
changeset
|
114 |
abort: '#' cannot be used in the name of a patch |
d3a00fc3680f
mq: use %r to format illegal characters instead of manually quoting
Augie Fackler <augie@google.com>
parents:
22521
diff
changeset
|
115 |
abort: ':' cannot be used in the name of a patch |
25454
b5a8bc09b0db
mq: ban \r and \n in patch names (issue4711)
Augie Fackler <augie@google.com>
parents:
25453
diff
changeset
|
116 |
abort: '\n' cannot be used in the name of a patch |
31556
448acdee9161
mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents:
26998
diff
changeset
|
117 |
abort: patch name cannot begin or end with whitespace |
448acdee9161
mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents:
26998
diff
changeset
|
118 |
abort: patch name cannot begin or end with whitespace |
12466 | 119 |
% qnew with name containing slash |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
31556
diff
changeset
|
120 |
abort: path ends in directory separator: foo/ |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
121 |
abort: "foo" already exists as a directory |
12466 | 122 |
foo/bar.patch |
123 |
popping foo/bar.patch |
|
124 |
patch queue now empty |
|
125 |
% qnew with uncommitted changes |
|
126 |
uncommitted.patch |
|
127 |
% qnew implies add |
|
128 |
A .hgignore |
|
129 |
A series |
|
130 |
A uncommitted.patch |
|
131 |
% qnew missing |
|
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
14054
diff
changeset
|
132 |
abort: missing: * (glob) |
12466 | 133 |
% qnew -m |
134 |
foo bar |
|
135 |
||
136 |
% qnew twice |
|
137 |
abort: patch "first.patch" already exists |
|
138 |
abort: patch "first.patch" already exists |
|
139 |
% qnew -f from a subdirectory |
|
140 |
popping first.patch |
|
141 |
popping mtest.patch |
|
142 |
popping uncommitted.patch |
|
143 |
patch queue now empty |
|
144 |
adding d/b |
|
145 |
M d/b |
|
146 |
diff --git a/d/b b/d/b |
|
147 |
--- a/d/b |
|
148 |
+++ b/d/b |
|
149 |
@@ -1,1 +1,2 @@ |
|
150 |
b |
|
151 |
+b |
|
152 |
% qnew -u with no username configured |
|
153 |
From: blue |
|
154 |
||
155 |
% qnew -e -u with no username configured |
|
156 |
From: chartreuse |
|
157 |
||
158 |
% fail when trying to import a merge |
|
159 |
adding a |
|
160 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
161 |
created new head |
|
162 |
merging a |
|
26614
ef1eb6df7071
simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents:
26587
diff
changeset
|
163 |
warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
12466 | 164 |
0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
35704
41ef02ba329b
merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents:
35393
diff
changeset
|
165 |
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
21947
b081decd9062
resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
21930
diff
changeset
|
166 |
(no more unresolved files) |
42532
12243f15d53e
statecheck: added support for STATES
Taapas Agrawal <taapas2897@gmail.com>
parents:
41362
diff
changeset
|
167 |
abort: outstanding uncommitted merge |
12243f15d53e
statecheck: added support for STATES
Taapas Agrawal <taapas2897@gmail.com>
parents:
41362
diff
changeset
|
168 |
(use 'hg commit' or 'hg merge --abort') |
12466 | 169 |
$ rm -r sandbox |
2714
85070b784896
Fix test-mq-qnew-twice exit code and output.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2711
diff
changeset
|
170 |
|
12466 | 171 |
hg headers |
11575
a5903e612f07
mq: evaluate --user before invoking editor with -e (issue2289)
Brendan Cully <brendan@kublai.com>
parents:
11513
diff
changeset
|
172 |
|
12466 | 173 |
$ echo "plain=false" >> $HGRCPATH |
174 |
$ mkdir sandbox |
|
175 |
$ (cd sandbox ; runtest) |
|
176 |
adding a |
|
177 |
% qnew should refuse bad patch names |
|
178 |
abort: "series" cannot be used as the name of a patch |
|
179 |
abort: "status" cannot be used as the name of a patch |
|
180 |
abort: "guards" cannot be used as the name of a patch |
|
14051
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
181 |
abort: "." cannot be used as the name of a patch |
2b1226693c70
mq: add '.' and '..' to list of forbidden patch names
Idan Kamara <idankk86@gmail.com>
parents:
13197
diff
changeset
|
182 |
abort: ".." cannot be used as the name of a patch |
14054
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
183 |
abort: patch name cannot begin with ".hg" |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
184 |
abort: patch name cannot begin with ".mq" |
25453
d3a00fc3680f
mq: use %r to format illegal characters instead of manually quoting
Augie Fackler <augie@google.com>
parents:
22521
diff
changeset
|
185 |
abort: '#' cannot be used in the name of a patch |
d3a00fc3680f
mq: use %r to format illegal characters instead of manually quoting
Augie Fackler <augie@google.com>
parents:
22521
diff
changeset
|
186 |
abort: ':' cannot be used in the name of a patch |
25454
b5a8bc09b0db
mq: ban \r and \n in patch names (issue4711)
Augie Fackler <augie@google.com>
parents:
25453
diff
changeset
|
187 |
abort: '\n' cannot be used in the name of a patch |
31556
448acdee9161
mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents:
26998
diff
changeset
|
188 |
abort: patch name cannot begin or end with whitespace |
448acdee9161
mq: reject new patch name containing leading/trailing whitespace
Yuya Nishihara <yuya@tcha.org>
parents:
26998
diff
changeset
|
189 |
abort: patch name cannot begin or end with whitespace |
12466 | 190 |
% qnew with name containing slash |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
31556
diff
changeset
|
191 |
abort: path ends in directory separator: foo/ |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
192 |
abort: "foo" already exists as a directory |
12466 | 193 |
foo/bar.patch |
194 |
popping foo/bar.patch |
|
195 |
patch queue now empty |
|
196 |
% qnew with uncommitted changes |
|
197 |
uncommitted.patch |
|
198 |
% qnew implies add |
|
199 |
A .hgignore |
|
200 |
A series |
|
201 |
A uncommitted.patch |
|
202 |
% qnew missing |
|
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
14054
diff
changeset
|
203 |
abort: missing: * (glob) |
12466 | 204 |
% qnew -m |
205 |
# HG changeset patch |
|
206 |
# Parent |
|
207 |
foo bar |
|
208 |
||
209 |
% qnew twice |
|
210 |
abort: patch "first.patch" already exists |
|
211 |
abort: patch "first.patch" already exists |
|
212 |
% qnew -f from a subdirectory |
|
213 |
popping first.patch |
|
214 |
popping mtest.patch |
|
215 |
popping uncommitted.patch |
|
216 |
patch queue now empty |
|
217 |
adding d/b |
|
218 |
M d/b |
|
219 |
# HG changeset patch |
|
220 |
# Parent |
|
22519
c87f2a5a6e49
mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents:
21947
diff
changeset
|
221 |
|
12466 | 222 |
diff --git a/d/b b/d/b |
223 |
--- a/d/b |
|
224 |
+++ b/d/b |
|
225 |
@@ -1,1 +1,2 @@ |
|
226 |
b |
|
227 |
+b |
|
228 |
% qnew -u with no username configured |
|
229 |
# HG changeset patch |
|
22520
9d4ebb75de53
mq: write headers for new HG patches in the same order as export (BC)
Mads Kiilerich <madski@unity3d.com>
parents:
22519
diff
changeset
|
230 |
# User blue |
12466 | 231 |
# Parent |
22519
c87f2a5a6e49
mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents:
21947
diff
changeset
|
232 |
|
12466 | 233 |
% qnew -e -u with no username configured |
234 |
# HG changeset patch |
|
22520
9d4ebb75de53
mq: write headers for new HG patches in the same order as export (BC)
Mads Kiilerich <madski@unity3d.com>
parents:
22519
diff
changeset
|
235 |
# User chartreuse |
12466 | 236 |
# Parent |
22519
c87f2a5a6e49
mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents:
21947
diff
changeset
|
237 |
|
12466 | 238 |
% fail when trying to import a merge |
239 |
adding a |
|
240 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
241 |
created new head |
|
242 |
merging a |
|
26614
ef1eb6df7071
simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents:
26587
diff
changeset
|
243 |
warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
12466 | 244 |
0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
35704
41ef02ba329b
merge: add `--abort` flag which can abort the merge
Pulkit Goyal <7895pulkit@gmail.com>
parents:
35393
diff
changeset
|
245 |
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
21947
b081decd9062
resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
21930
diff
changeset
|
246 |
(no more unresolved files) |
42532
12243f15d53e
statecheck: added support for STATES
Taapas Agrawal <taapas2897@gmail.com>
parents:
41362
diff
changeset
|
247 |
abort: outstanding uncommitted merge |
12243f15d53e
statecheck: added support for STATES
Taapas Agrawal <taapas2897@gmail.com>
parents:
41362
diff
changeset
|
248 |
(use 'hg commit' or 'hg merge --abort') |
12466 | 249 |
$ rm -r sandbox |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
250 |
|
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
251 |
Test saving last-message.txt |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
252 |
|
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
253 |
$ hg init repo |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
254 |
$ cd repo |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
255 |
|
20859
e259d4c462b5
tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents:
20768
diff
changeset
|
256 |
$ cat > $TESTTMP/commitfailure.py <<EOF |
26587
56b2bcea2529
error: get Abort from 'error' instead of 'util'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25454
diff
changeset
|
257 |
> from mercurial import error |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
258 |
> def reposetup(ui, repo): |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
259 |
> class commitfailure(repo.__class__): |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
260 |
> def commit(self, *args, **kwargs): |
26587
56b2bcea2529
error: get Abort from 'error' instead of 'util'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
25454
diff
changeset
|
261 |
> raise error.Abort('emulating unexpected abort') |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
262 |
> repo.__class__ = commitfailure |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
263 |
> EOF |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
264 |
$ cat >> .hg/hgrc <<EOF |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
265 |
> [extensions] |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
266 |
> # this failure occurs before editor invocation |
20859
e259d4c462b5
tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents:
20768
diff
changeset
|
267 |
> commitfailure = $TESTTMP/commitfailure.py |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
268 |
> EOF |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
269 |
|
20859
e259d4c462b5
tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents:
20768
diff
changeset
|
270 |
$ cat > $TESTTMP/editor.sh << EOF |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
271 |
> echo "==== before editing" |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
272 |
> cat \$1 |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
273 |
> echo "====" |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
274 |
> echo "test saving last-message.txt" >> \$1 |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
275 |
> EOF |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
276 |
|
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
277 |
(test that editor is not invoked before transaction starting) |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
278 |
|
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
279 |
$ rm -f .hg/last-message.txt |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
280 |
$ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
281 |
abort: emulating unexpected abort |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
282 |
[255] |
21930
a5168eb9b2bc
tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents:
21421
diff
changeset
|
283 |
$ test -f .hg/last-message.txt |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
284 |
[1] |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
285 |
|
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
286 |
(test that editor is invoked and commit message is saved into |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
287 |
"last-message.txt") |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
288 |
|
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
289 |
$ cat >> .hg/hgrc <<EOF |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
290 |
> [extensions] |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
291 |
> commitfailure = ! |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
292 |
> [hooks] |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
293 |
> # this failure occurs after editor invocation |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
294 |
> pretxncommit.unexpectedabort = false |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
295 |
> EOF |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
296 |
|
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
297 |
$ rm -f .hg/last-message.txt |
21421
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
298 |
$ hg status |
20859
e259d4c462b5
tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents:
20768
diff
changeset
|
299 |
$ HGEDITOR="sh $TESTTMP/editor.sh" hg qnew -e patch |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
300 |
==== before editing |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
301 |
|
21421
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
302 |
|
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
303 |
HG: Enter commit message. Lines beginning with 'HG:' are removed. |
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
304 |
HG: Leave message empty to use default message. |
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
305 |
HG: -- |
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
306 |
HG: user: test |
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
307 |
HG: branch 'default' |
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
308 |
HG: no files changed |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
309 |
==== |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
310 |
transaction abort! |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
311 |
rollback completed |
41362
57c462db87fd
localrepo: use context manager for transaction in commit()
Martin von Zweigbergk <martinvonz@google.com>
parents:
35704
diff
changeset
|
312 |
note: commit message saved in .hg/last-message.txt |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
313 |
abort: pretxncommit.unexpectedabort hook exited with status 1 |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
314 |
[255] |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
315 |
$ cat .hg/last-message.txt |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
316 |
|
21421
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
317 |
|
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
318 |
test saving last-message.txt |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
319 |
|
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
320 |
$ cat >> .hg/hgrc <<EOF |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
321 |
> [hooks] |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
322 |
> pretxncommit.unexpectedabort = |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
323 |
> EOF |