Mercurial > hg
annotate tests/test-mq-qnew.t @ 25295:701df761aa94
branch: don't warn about branches if repository has multiple branches already
This warning exists to prevent git users from prematurely polluting
their namespace when trying out Mercurial. But for repos that already
have multiple branches, understanding what branches are is not
optional so we should just shut up.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 22 May 2015 17:08:59 -0500 |
parents | 3f948469bac0 |
children | d3a00fc3680f |
rev | line source |
---|---|
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' | |
24 > | |
25 > hg qinit -c | |
26 > | |
27 > 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
|
28 > hg qnew foo/ |
12466 | 29 > hg qnew foo/bar.patch |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
30 > hg qnew foo |
12466 | 31 > hg qseries |
32 > hg qpop | |
33 > hg qdelete foo/bar.patch | |
34 > | |
35 > echo '% qnew with uncommitted changes' | |
36 > echo a > somefile | |
37 > hg add somefile | |
38 > hg qnew uncommitted.patch | |
39 > hg st | |
40 > hg qseries | |
41 > | |
42 > echo '% qnew implies add' | |
43 > hg -R .hg/patches st | |
44 > | |
45 > echo '% qnew missing' | |
46 > hg qnew missing.patch missing | |
47 > | |
48 > echo '% qnew -m' | |
49 > hg qnew -m 'foo bar' mtest.patch | |
50 > catpatch .hg/patches/mtest.patch | |
51 > | |
52 > echo '% qnew twice' | |
53 > hg qnew first.patch | |
54 > hg qnew first.patch | |
55 > | |
56 > touch ../first.patch | |
57 > hg qimport ../first.patch | |
58 > | |
59 > echo '% qnew -f from a subdirectory' | |
60 > hg qpop -a | |
61 > mkdir d | |
62 > cd d | |
63 > echo b > b | |
64 > hg ci -Am t | |
65 > echo b >> b | |
66 > hg st | |
67 > hg qnew -g -f p | |
68 > catpatch ../.hg/patches/p | |
69 > | |
70 > echo '% qnew -u with no username configured' | |
71 > HGUSER= hg qnew -u blue red | |
72 > catpatch ../.hg/patches/red | |
73 > | |
74 > echo '% qnew -e -u with no username configured' | |
75 > HGUSER= hg qnew -e -u chartreuse fucsia | |
76 > catpatch ../.hg/patches/fucsia | |
77 > | |
78 > echo '% fail when trying to import a merge' | |
79 > hg init merge | |
80 > cd merge | |
81 > touch a | |
82 > hg ci -Am null | |
83 > echo a >> a | |
84 > hg ci -m a | |
85 > hg up -r 0 | |
86 > echo b >> a | |
87 > hg ci -m b | |
88 > hg merge -f 1 | |
89 > hg resolve --mark a | |
90 > hg qnew -f merge | |
91 > | |
92 > cd ../../.. | |
93 > rm -r mq | |
94 > } | |
10397
8cb81d75730c
mq: add parent node IDs to MQ patches on qrefresh/qnew
Steve Losh <steve@stevelosh.com>
parents:
10372
diff
changeset
|
95 |
12466 | 96 plain headers |
7296
695383442347
mq: put qnew tests into own file, fold in qnew-twice
Brendan Cully <brendan@kublai.com>
parents:
2990
diff
changeset
|
97 |
12466 | 98 $ echo "[mq]" >> $HGRCPATH |
99 $ echo "plain=true" >> $HGRCPATH | |
100 $ mkdir sandbox | |
101 $ (cd sandbox ; runtest) | |
102 adding a | |
103 % qnew should refuse bad patch names | |
104 abort: "series" cannot be used as the name of a patch | |
105 abort: "status" cannot be used as the name of a patch | |
106 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
|
107 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
|
108 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
|
109 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
|
110 abort: patch name cannot begin with ".mq" |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
111 abort: "#" cannot be used in the name of a patch |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
112 abort: ":" cannot be used in the name of a patch |
12466 | 113 % qnew with name containing slash |
16540
4fe8eb4a6e2c
tests: add missing accept of native pathname separator
Mads Kiilerich <mads@kiilerich.com>
parents:
15524
diff
changeset
|
114 abort: path ends in directory separator: foo/ (glob) |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
115 abort: "foo" already exists as a directory |
12466 | 116 foo/bar.patch |
117 popping foo/bar.patch | |
118 patch queue now empty | |
119 % qnew with uncommitted changes | |
120 uncommitted.patch | |
121 % qnew implies add | |
122 A .hgignore | |
123 A series | |
124 A uncommitted.patch | |
125 % qnew missing | |
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
14054
diff
changeset
|
126 abort: missing: * (glob) |
12466 | 127 % qnew -m |
128 foo bar | |
129 | |
130 % qnew twice | |
131 abort: patch "first.patch" already exists | |
132 abort: patch "first.patch" already exists | |
133 % qnew -f from a subdirectory | |
134 popping first.patch | |
135 popping mtest.patch | |
136 popping uncommitted.patch | |
137 patch queue now empty | |
138 adding d/b | |
139 M d/b | |
140 diff --git a/d/b b/d/b | |
141 --- a/d/b | |
142 +++ b/d/b | |
143 @@ -1,1 +1,2 @@ | |
144 b | |
145 +b | |
146 % qnew -u with no username configured | |
147 From: blue | |
148 | |
149 % qnew -e -u with no username configured | |
150 From: chartreuse | |
151 | |
152 % fail when trying to import a merge | |
153 adding a | |
154 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
155 created new head | |
156 merging a | |
157 warning: conflicts during merge. | |
15501
2371f4aea665
merge: give a special message for internal:merge failure (issue3105)
Matt Mackall <mpm@selenic.com>
parents:
14054
diff
changeset
|
158 merging a incomplete! (edit conflicts, then use 'hg resolve --mark') |
12466 | 159 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
160 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' 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
|
161 (no more unresolved files) |
12466 | 162 abort: cannot manage merge changesets |
163 $ rm -r sandbox | |
2714
85070b784896
Fix test-mq-qnew-twice exit code and output.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
2711
diff
changeset
|
164 |
12466 | 165 hg headers |
11575
a5903e612f07
mq: evaluate --user before invoking editor with -e (issue2289)
Brendan Cully <brendan@kublai.com>
parents:
11513
diff
changeset
|
166 |
12466 | 167 $ echo "plain=false" >> $HGRCPATH |
168 $ mkdir sandbox | |
169 $ (cd sandbox ; runtest) | |
170 adding a | |
171 % qnew should refuse bad patch names | |
172 abort: "series" cannot be used as the name of a patch | |
173 abort: "status" cannot be used as the name of a patch | |
174 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
|
175 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
|
176 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
|
177 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
|
178 abort: patch name cannot begin with ".mq" |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
179 abort: "#" cannot be used in the name of a patch |
3c616f512a5b
mq: be more explicit on invalid patch name message
Idan Kamara <idankk86@gmail.com>
parents:
14051
diff
changeset
|
180 abort: ":" cannot be used in the name of a patch |
12466 | 181 % qnew with name containing slash |
16540
4fe8eb4a6e2c
tests: add missing accept of native pathname separator
Mads Kiilerich <mads@kiilerich.com>
parents:
15524
diff
changeset
|
182 abort: path ends in directory separator: foo/ (glob) |
12879
da4a9ed369c8
qnew: distinguish between existing file and directory (issue2464)
Martin Geisler <mg@aragost.com>
parents:
12878
diff
changeset
|
183 abort: "foo" already exists as a directory |
12466 | 184 foo/bar.patch |
185 popping foo/bar.patch | |
186 patch queue now empty | |
187 % qnew with uncommitted changes | |
188 uncommitted.patch | |
189 % qnew implies add | |
190 A .hgignore | |
191 A series | |
192 A uncommitted.patch | |
193 % qnew missing | |
15521
117f9190c1ba
tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents:
14054
diff
changeset
|
194 abort: missing: * (glob) |
12466 | 195 % qnew -m |
196 # HG changeset patch | |
197 # Parent | |
198 foo bar | |
199 | |
200 % qnew twice | |
201 abort: patch "first.patch" already exists | |
202 abort: patch "first.patch" already exists | |
203 % qnew -f from a subdirectory | |
204 popping first.patch | |
205 popping mtest.patch | |
206 popping uncommitted.patch | |
207 patch queue now empty | |
208 adding d/b | |
209 M d/b | |
210 # HG changeset patch | |
211 # Parent | |
22519
c87f2a5a6e49
mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents:
21947
diff
changeset
|
212 |
12466 | 213 diff --git a/d/b b/d/b |
214 --- a/d/b | |
215 +++ b/d/b | |
216 @@ -1,1 +1,2 @@ | |
217 b | |
218 +b | |
219 % qnew -u with no username configured | |
220 # 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
|
221 # User blue |
12466 | 222 # Parent |
22519
c87f2a5a6e49
mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents:
21947
diff
changeset
|
223 |
12466 | 224 % qnew -e -u with no username configured |
225 # 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
|
226 # User chartreuse |
12466 | 227 # Parent |
22519
c87f2a5a6e49
mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents:
21947
diff
changeset
|
228 |
12466 | 229 % fail when trying to import a merge |
230 adding a | |
231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
232 created new head | |
233 merging a | |
234 warning: conflicts during merge. | |
15501
2371f4aea665
merge: give a special message for internal:merge failure (issue3105)
Matt Mackall <mpm@selenic.com>
parents:
14054
diff
changeset
|
235 merging a incomplete! (edit conflicts, then use 'hg resolve --mark') |
12466 | 236 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
237 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' 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
|
238 (no more unresolved files) |
12466 | 239 abort: cannot manage merge changesets |
240 $ 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
|
241 |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
242 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
|
243 |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
244 $ 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
|
245 $ 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
|
246 |
20859
e259d4c462b5
tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents:
20768
diff
changeset
|
247 $ cat > $TESTTMP/commitfailure.py <<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
|
248 > from mercurial import util |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
249 > 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
|
250 > 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
|
251 > def commit(self, *args, **kwargs): |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
252 > raise util.Abort('emulating unexpected abort') |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
253 > 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
|
254 > 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
|
255 $ 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
|
256 > [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
|
257 > # 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
|
258 > 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
|
259 > EOF |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
260 |
20859
e259d4c462b5
tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents:
20768
diff
changeset
|
261 $ 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
|
262 > 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
|
263 > 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
|
264 > echo "====" |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
265 > 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
|
266 > EOF |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
267 |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
268 (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
|
269 |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
270 $ 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
|
271 $ 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
|
272 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
|
273 [255] |
21930
a5168eb9b2bc
tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents:
21421
diff
changeset
|
274 $ 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
|
275 [1] |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
276 |
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 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
|
278 "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
|
279 |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
280 $ 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
|
281 > [extensions] |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
282 > commitfailure = ! |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
283 > [hooks] |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
284 > # 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
|
285 > 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
|
286 > EOF |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
287 |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
288 $ 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
|
289 $ hg status |
20859
e259d4c462b5
tests: use TESTTMP instead of TESTDIR
Sean Farley <sean.michael.farley@gmail.com>
parents:
20768
diff
changeset
|
290 $ 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
|
291 ==== 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
|
292 |
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
|
293 |
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
294 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
|
295 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
|
296 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
|
297 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
|
298 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
|
299 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
|
300 ==== |
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 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
|
302 rollback completed |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
303 note: commit message saved in .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
|
304 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
|
305 [255] |
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
306 $ 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
|
307 |
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
|
308 |
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 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
|
310 |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
311 $ 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
|
312 > [hooks] |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
313 > 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
|
314 > EOF |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
315 |
21276
25b7c760235a
tests: fix test failure on vfat
Matt Mackall <mpm@selenic.com>
parents:
21267
diff
changeset
|
316 #if unix-permissions |
25b7c760235a
tests: fix test failure on vfat
Matt Mackall <mpm@selenic.com>
parents:
21267
diff
changeset
|
317 |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
318 Test handling default message with the patch filename with tail whitespaces |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
319 |
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 > $TESTTMP/editor.sh << 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 > echo "==== before editing" |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
322 > cat \$1 |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
323 > echo "====" |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
324 > echo "[mq]: patch " > \$1 |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
325 > EOF |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
326 |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
327 $ 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
|
328 $ hg status |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
329 $ 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
|
330 ==== before editing |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
331 |
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
|
332 |
4941caa9f0f8
mq: use the editor gotten by "getcommiteditor()" instead of "ui.edit()" (qnew)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
21276
diff
changeset
|
333 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
|
334 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
|
335 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
|
336 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
|
337 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
|
338 HG: no files changed |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
339 ==== |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
340 $ cat ".hg/patches/patch " |
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
341 # HG changeset patch |
22521
3f948469bac0
mq: write '# Parent ' lines with two spaces like export does (BC)
Mads Kiilerich <madski@unity3d.com>
parents:
22520
diff
changeset
|
342 # Parent 0000000000000000000000000000000000000000 |
22519
c87f2a5a6e49
mq: correctly make an empty line after description in new patches
Mads Kiilerich <madski@unity3d.com>
parents:
21947
diff
changeset
|
343 |
21234
b9a16ed5acec
qnew: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
20859
diff
changeset
|
344 |
20768
57d0c8c3b947
qnew: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
16540
diff
changeset
|
345 $ cd .. |
21276
25b7c760235a
tests: fix test failure on vfat
Matt Mackall <mpm@selenic.com>
parents:
21267
diff
changeset
|
346 |
25b7c760235a
tests: fix test failure on vfat
Matt Mackall <mpm@selenic.com>
parents:
21267
diff
changeset
|
347 #endif |