##// END OF EJS Templates
tests: update test-releasenotes-formatting.t output...
Pulkit Goyal -
r44477:df470e76 default
parent child Browse files
Show More
@@ -1,491 +1,491 b''
1 #require fuzzywuzzy
1 #require fuzzywuzzy
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > releasenotes=
5 > releasenotes=
6 > EOF
6 > EOF
7
7
8 $ hg init simple-repo
8 $ hg init simple-repo
9 $ cd simple-repo
9 $ cd simple-repo
10
10
11 A fix with a single line results in a bullet point in the appropriate section
11 A fix with a single line results in a bullet point in the appropriate section
12
12
13 $ touch fix1
13 $ touch fix1
14 $ hg -q commit -A -l - << EOF
14 $ hg -q commit -A -l - << EOF
15 > single line fix
15 > single line fix
16 >
16 >
17 > .. fix::
17 > .. fix::
18 >
18 >
19 > Simple fix with a single line content entry.
19 > Simple fix with a single line content entry.
20 > EOF
20 > EOF
21
21
22 $ hg releasenotes -r . $TESTTMP/relnotes-single-line
22 $ hg releasenotes -r . $TESTTMP/relnotes-single-line
23
23
24 $ cat $TESTTMP/relnotes-single-line
24 $ cat $TESTTMP/relnotes-single-line
25 Bug Fixes
25 Bug Fixes
26 =========
26 =========
27
27
28 * Simple fix with a single line content entry.
28 * Simple fix with a single line content entry.
29
29
30 A fix with multiple lines is handled correctly
30 A fix with multiple lines is handled correctly
31
31
32 $ touch fix2
32 $ touch fix2
33 $ hg -q commit -A -l - << EOF
33 $ hg -q commit -A -l - << EOF
34 > multi line fix
34 > multi line fix
35 >
35 >
36 > .. fix::
36 > .. fix::
37 >
37 >
38 > First line of fix entry.
38 > First line of fix entry.
39 > A line after it without a space.
39 > A line after it without a space.
40 >
40 >
41 > A new paragraph in the fix entry. And this is a really long line. It goes on for a while.
41 > A new paragraph in the fix entry. And this is a really long line. It goes on for a while.
42 > And it wraps around to a new paragraph.
42 > And it wraps around to a new paragraph.
43 > EOF
43 > EOF
44
44
45 $ hg releasenotes -r . $TESTTMP/relnotes-multi-line
45 $ hg releasenotes -r . $TESTTMP/relnotes-multi-line
46 $ cat $TESTTMP/relnotes-multi-line
46 $ cat $TESTTMP/relnotes-multi-line
47 Bug Fixes
47 Bug Fixes
48 =========
48 =========
49
49
50 * First line of fix entry. A line after it without a space.
50 * First line of fix entry. A line after it without a space.
51
51
52 A new paragraph in the fix entry. And this is a really long line. It goes on
52 A new paragraph in the fix entry. And this is a really long line. It goes on
53 for a while. And it wraps around to a new paragraph.
53 for a while. And it wraps around to a new paragraph.
54
54
55 A release note with a title results in a sub-section being written
55 A release note with a title results in a sub-section being written
56
56
57 $ touch fix3
57 $ touch fix3
58 $ hg -q commit -A -l - << EOF
58 $ hg -q commit -A -l - << EOF
59 > fix with title
59 > fix with title
60 >
60 >
61 > .. fix:: Fix Title
61 > .. fix:: Fix Title
62 >
62 >
63 > First line of fix with title.
63 > First line of fix with title.
64 >
64 >
65 > Another paragraph of fix with title. But this is a paragraph
65 > Another paragraph of fix with title. But this is a paragraph
66 > with multiple lines.
66 > with multiple lines.
67 > EOF
67 > EOF
68
68
69 $ hg releasenotes -r . $TESTTMP/relnotes-fix-with-title
69 $ hg releasenotes -r . $TESTTMP/relnotes-fix-with-title
70 $ cat $TESTTMP/relnotes-fix-with-title
70 $ cat $TESTTMP/relnotes-fix-with-title
71 Bug Fixes
71 Bug Fixes
72 =========
72 =========
73
73
74 Fix Title
74 Fix Title
75 ---------
75 ---------
76
76
77 First line of fix with title.
77 First line of fix with title.
78
78
79 Another paragraph of fix with title. But this is a paragraph with multiple
79 Another paragraph of fix with title. But this is a paragraph with multiple
80 lines.
80 lines.
81
81
82 $ cd ..
82 $ cd ..
83
83
84 Formatting of multiple bullet points works
84 Formatting of multiple bullet points works
85
85
86 $ hg init multiple-bullets
86 $ hg init multiple-bullets
87 $ cd multiple-bullets
87 $ cd multiple-bullets
88 $ touch fix1
88 $ touch fix1
89 $ hg -q commit -A -l - << EOF
89 $ hg -q commit -A -l - << EOF
90 > commit 1
90 > commit 1
91 >
91 >
92 > .. fix::
92 > .. fix::
93 >
93 >
94 > first fix
94 > first fix
95 > EOF
95 > EOF
96
96
97 $ touch fix2
97 $ touch fix2
98 $ hg -q commit -A -l - << EOF
98 $ hg -q commit -A -l - << EOF
99 > commit 2
99 > commit 2
100 >
100 >
101 > .. fix::
101 > .. fix::
102 >
102 >
103 > second fix
103 > second fix
104 >
104 >
105 > Second paragraph of second fix.
105 > Second paragraph of second fix.
106 > EOF
106 > EOF
107
107
108 $ touch fix3
108 $ touch fix3
109 $ hg -q commit -A -l - << EOF
109 $ hg -q commit -A -l - << EOF
110 > commit 3
110 > commit 3
111 >
111 >
112 > .. fix::
112 > .. fix::
113 >
113 >
114 > third fix
114 > third fix
115 > EOF
115 > EOF
116
116
117 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-bullets
117 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-bullets
118 $ cat $TESTTMP/relnotes-multiple-bullets
118 $ cat $TESTTMP/relnotes-multiple-bullets
119 Bug Fixes
119 Bug Fixes
120 =========
120 =========
121
121
122 * first fix
122 * first fix
123
123
124 * second fix
124 * second fix
125
125
126 Second paragraph of second fix.
126 Second paragraph of second fix.
127
127
128 * third fix
128 * third fix
129
129
130 $ cd ..
130 $ cd ..
131
131
132 Formatting of multiple sections works
132 Formatting of multiple sections works
133
133
134 $ hg init multiple-sections
134 $ hg init multiple-sections
135 $ cd multiple-sections
135 $ cd multiple-sections
136 $ touch fix1
136 $ touch fix1
137 $ hg -q commit -A -l - << EOF
137 $ hg -q commit -A -l - << EOF
138 > commit 1
138 > commit 1
139 >
139 >
140 > .. fix::
140 > .. fix::
141 >
141 >
142 > first fix
142 > first fix
143 > EOF
143 > EOF
144
144
145 $ touch feature1
145 $ touch feature1
146 $ hg -q commit -A -l - << EOF
146 $ hg -q commit -A -l - << EOF
147 > commit 2
147 > commit 2
148 >
148 >
149 > .. feature::
149 > .. feature::
150 >
150 >
151 > description of the new feature
151 > description of the new feature
152 > EOF
152 > EOF
153
153
154 $ touch fix2
154 $ touch fix2
155 $ hg -q commit -A -l - << EOF
155 $ hg -q commit -A -l - << EOF
156 > commit 3
156 > commit 3
157 >
157 >
158 > .. fix::
158 > .. fix::
159 >
159 >
160 > second fix
160 > second fix
161 > EOF
161 > EOF
162
162
163 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-sections
163 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-sections
164 $ cat $TESTTMP/relnotes-multiple-sections
164 $ cat $TESTTMP/relnotes-multiple-sections
165 New Features
165 New Features
166 ============
166 ============
167
167
168 * description of the new feature
168 * description of the new feature
169
169
170 Bug Fixes
170 Bug Fixes
171 =========
171 =========
172
172
173 * first fix
173 * first fix
174
174
175 * second fix
175 * second fix
176
176
177 $ cd ..
177 $ cd ..
178
178
179 Section with subsections and bullets
179 Section with subsections and bullets
180
180
181 $ hg init multiple-subsections
181 $ hg init multiple-subsections
182 $ cd multiple-subsections
182 $ cd multiple-subsections
183
183
184 $ touch fix1
184 $ touch fix1
185 $ hg -q commit -A -l - << EOF
185 $ hg -q commit -A -l - << EOF
186 > commit 1
186 > commit 1
187 >
187 >
188 > .. fix:: Title of First Fix
188 > .. fix:: Title of First Fix
189 >
189 >
190 > First paragraph of first fix.
190 > First paragraph of first fix.
191 >
191 >
192 > Second paragraph of first fix.
192 > Second paragraph of first fix.
193 > EOF
193 > EOF
194
194
195 $ touch fix2
195 $ touch fix2
196 $ hg -q commit -A -l - << EOF
196 $ hg -q commit -A -l - << EOF
197 > commit 2
197 > commit 2
198 >
198 >
199 > .. fix:: Title of Second Fix
199 > .. fix:: Title of Second Fix
200 >
200 >
201 > First paragraph of second fix.
201 > First paragraph of second fix.
202 >
202 >
203 > Second paragraph of second fix.
203 > Second paragraph of second fix.
204 > EOF
204 > EOF
205
205
206 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-subsections
206 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-subsections
207 $ cat $TESTTMP/relnotes-multiple-subsections
207 $ cat $TESTTMP/relnotes-multiple-subsections
208 Bug Fixes
208 Bug Fixes
209 =========
209 =========
210
210
211 Title of First Fix
211 Title of First Fix
212 ------------------
212 ------------------
213
213
214 First paragraph of first fix.
214 First paragraph of first fix.
215
215
216 Second paragraph of first fix.
216 Second paragraph of first fix.
217
217
218 Title of Second Fix
218 Title of Second Fix
219 -------------------
219 -------------------
220
220
221 First paragraph of second fix.
221 First paragraph of second fix.
222
222
223 Second paragraph of second fix.
223 Second paragraph of second fix.
224
224
225 Now add bullet points to sections having sub-sections
225 Now add bullet points to sections having sub-sections
226
226
227 $ touch fix3
227 $ touch fix3
228 $ hg -q commit -A -l - << EOF
228 $ hg -q commit -A -l - << EOF
229 > commit 3
229 > commit 3
230 >
230 >
231 > .. fix::
231 > .. fix::
232 >
232 >
233 > Short summary of fix 3
233 > Short summary of fix 3
234 > EOF
234 > EOF
235
235
236 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-subsections-with-bullets
236 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-subsections-with-bullets
237 $ cat $TESTTMP/relnotes-multiple-subsections-with-bullets
237 $ cat $TESTTMP/relnotes-multiple-subsections-with-bullets
238 Bug Fixes
238 Bug Fixes
239 =========
239 =========
240
240
241 Title of First Fix
241 Title of First Fix
242 ------------------
242 ------------------
243
243
244 First paragraph of first fix.
244 First paragraph of first fix.
245
245
246 Second paragraph of first fix.
246 Second paragraph of first fix.
247
247
248 Title of Second Fix
248 Title of Second Fix
249 -------------------
249 -------------------
250
250
251 First paragraph of second fix.
251 First paragraph of second fix.
252
252
253 Second paragraph of second fix.
253 Second paragraph of second fix.
254
254
255 Other Changes
255 Other Changes
256 -------------
256 -------------
257
257
258 * Short summary of fix 3
258 * Short summary of fix 3
259
259
260 $ cd ..
260 $ cd ..
261
261
262 Multiple 'Other Changes' sub-sections for every section
262 Multiple 'Other Changes' sub-sections for every section
263
263
264 $ hg init multiple-otherchanges
264 $ hg init multiple-otherchanges
265 $ cd multiple-otherchanges
265 $ cd multiple-otherchanges
266
266
267 $ touch fix1
267 $ touch fix1
268 $ hg -q commit -A -l - << EOF
268 $ hg -q commit -A -l - << EOF
269 > commit 1
269 > commit 1
270 >
270 >
271 > .. fix:: Title of First Fix
271 > .. fix:: Title of First Fix
272 >
272 >
273 > First paragraph of fix 1.
273 > First paragraph of fix 1.
274 > EOF
274 > EOF
275
275
276 $ touch feature1
276 $ touch feature1
277 $ hg -q commit -A -l - << EOF
277 $ hg -q commit -A -l - << EOF
278 > commit 2
278 > commit 2
279 >
279 >
280 > .. feature:: Title of First Feature
280 > .. feature:: Title of First Feature
281 >
281 >
282 > First paragraph of feature 1.
282 > First paragraph of feature 1.
283 > EOF
283 > EOF
284
284
285 $ touch feature2
285 $ touch feature2
286 $ hg -q commit -A -l - << EOF
286 $ hg -q commit -A -l - << EOF
287 > commit 3
287 > commit 3
288 >
288 >
289 > .. feature::
289 > .. feature::
290 >
290 >
291 > Short summary of feature 2.
291 > Short summary of feature 2.
292 > EOF
292 > EOF
293
293
294 $ touch fix2
294 $ touch fix2
295 $ hg -q commit -A -l - << EOF
295 $ hg -q commit -A -l - << EOF
296 > commit 4
296 > commit 4
297 >
297 >
298 > .. fix::
298 > .. fix::
299 >
299 >
300 > Short summary of fix 2
300 > Short summary of fix 2
301 > EOF
301 > EOF
302
302
303 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-otherchanges
303 $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-otherchanges
304 $ cat $TESTTMP/relnotes-multiple-otherchanges
304 $ cat $TESTTMP/relnotes-multiple-otherchanges
305 New Features
305 New Features
306 ============
306 ============
307
307
308 Title of First Feature
308 Title of First Feature
309 ----------------------
309 ----------------------
310
310
311 First paragraph of feature 1.
311 First paragraph of feature 1.
312
312
313 Other Changes
313 Other Changes
314 -------------
314 -------------
315
315
316 * Short summary of feature 2.
316 * Short summary of feature 2.
317
317
318 Bug Fixes
318 Bug Fixes
319 =========
319 =========
320
320
321 Title of First Fix
321 Title of First Fix
322 ------------------
322 ------------------
323
323
324 First paragraph of fix 1.
324 First paragraph of fix 1.
325
325
326 Other Changes
326 Other Changes
327 -------------
327 -------------
328
328
329 * Short summary of fix 2
329 * Short summary of fix 2
330
330
331 $ cd ..
331 $ cd ..
332
332
333 Using custom sections in notes
333 Using custom sections in notes
334
334
335 $ hg init custom-section
335 $ hg init custom-section
336 $ cd custom-section
336 $ cd custom-section
337 $ cat >> .hgreleasenotes << EOF
337 $ cat >> .hgreleasenotes << EOF
338 > [sections]
338 > [sections]
339 > testsection=Name of Section
339 > testsection=Name of Section
340 > EOF
340 > EOF
341
341
342 $ touch a
342 $ touch a
343 $ hg -q commit -A -l - << EOF
343 $ hg -q commit -A -l - << EOF
344 > commit 1
344 > commit 1
345 >
345 >
346 > .. testsection::
346 > .. testsection::
347 >
347 >
348 > First paragraph under this admonition.
348 > First paragraph under this admonition.
349 > EOF
349 > EOF
350
350
351 $ hg releasenotes -r . $TESTTMP/relnotes-custom-section
351 $ hg releasenotes -r . $TESTTMP/relnotes-custom-section
352 $ cat $TESTTMP/relnotes-custom-section
352 $ cat $TESTTMP/relnotes-custom-section
353 Name of Section
353 Name of Section
354 ===============
354 ===============
355
355
356 * First paragraph under this admonition.
356 * First paragraph under this admonition.
357
357
358 Overriding default sections (For eg. by default feature = New Features)
358 Overriding default sections (For eg. by default feature = New Features)
359
359
360 $ cat >> .hgreleasenotes << EOF
360 $ cat >> .hgreleasenotes << EOF
361 > [sections]
361 > [sections]
362 > feature=Feature Additions
362 > feature=Feature Additions
363 > EOF
363 > EOF
364
364
365 $ touch b
365 $ touch b
366 $ hg -q commit -A -l - << EOF
366 $ hg -q commit -A -l - << EOF
367 > commit 2
367 > commit 2
368 >
368 >
369 > .. feature::
369 > .. feature::
370 >
370 >
371 > Adds a new feature.
371 > Adds a new feature.
372 > EOF
372 > EOF
373
373
374 $ hg releasenotes -r . $TESTTMP/relnotes-override-section
374 $ hg releasenotes -r . $TESTTMP/relnotes-override-section
375 $ cat $TESTTMP/relnotes-override-section
375 $ cat $TESTTMP/relnotes-override-section
376 Feature Additions
376 Feature Additions
377 =================
377 =================
378
378
379 * Adds a new feature.
379 * Adds a new feature.
380
380
381 $ cd ..
381 $ cd ..
382
382
383 Testing output for the --check (-c) flag
383 Testing output for the --check (-c) flag
384
384
385 $ hg init check-flag
385 $ hg init check-flag
386 $ cd check-flag
386 $ cd check-flag
387
387
388 $ touch a
388 $ touch a
389 $ hg -q commit -A -l - << EOF
389 $ hg -q commit -A -l - << EOF
390 > .. asf::
390 > .. asf::
391 >
391 >
392 > First paragraph under this admonition.
392 > First paragraph under this admonition.
393 > EOF
393 > EOF
394
394
395 Suggest similar admonition in place of the invalid one.
395 Suggest similar admonition in place of the invalid one.
396
396
397 $ hg releasenotes -r . -c
397 $ hg releasenotes -r . -c
398 Invalid admonition 'asf' present in changeset 4026fe9e1c20
398 Invalid admonition 'asf' present in changeset 4026fe9e1c20
399
399
400 $ touch b
400 $ touch b
401 $ hg -q commit -A -l - << EOF
401 $ hg -q commit -A -l - << EOF
402 > .. fixes::
402 > .. fixes::
403 >
403 >
404 > First paragraph under this admonition.
404 > First paragraph under this admonition.
405 > EOF
405 > EOF
406
406
407 $ hg releasenotes -r . -c
407 $ hg releasenotes -r . -c
408 Invalid admonition 'fixes' present in changeset 0e7130d2705c
408 Invalid admonition 'fixes' present in changeset 0e7130d2705c
409 (did you mean fix?)
409 (did you mean fix?)
410
410
411 $ cd ..
411 $ cd ..
412
412
413 Usage of --list flag
413 Usage of --list flag
414
414
415 $ hg init relnotes-list
415 $ hg init relnotes-list
416 $ cd relnotes-list
416 $ cd relnotes-list
417 $ hg releasenotes -l
417 $ hg releasenotes -l
418 feature: New Features
418 feature: New Features
419 bc: Backwards Compatibility Changes
419 bc: Backwards Compatibility Changes
420 fix: Bug Fixes
420 fix: Bug Fixes
421 perf: Performance Improvements
421 perf: Performance Improvements
422 api: API Changes
422 api: API Changes
423
423
424 $ cd ..
424 $ cd ..
425
425
426 Raise error on simultaneous usage of flags
426 Raise error on simultaneous usage of flags
427
427
428 $ hg init relnotes-raise-error
428 $ hg init relnotes-raise-error
429 $ cd relnotes-raise-error
429 $ cd relnotes-raise-error
430 $ hg releasenotes -r . -l
430 $ hg releasenotes -r . -l
431 abort: cannot use both '--list' and '--rev'
431 abort: cannot specify both --list and --rev
432 [255]
432 [255]
433
433
434 $ hg releasenotes -l -c
434 $ hg releasenotes -l -c
435 abort: cannot use both '--list' and '--check'
435 abort: cannot specify both --list and --check
436 [255]
436 [255]
437
437
438 Display release notes for specified revs if no file is mentioned
438 Display release notes for specified revs if no file is mentioned
439
439
440 $ hg init relnotes-nofile
440 $ hg init relnotes-nofile
441 $ cd relnotes-nofile
441 $ cd relnotes-nofile
442
442
443 $ touch fix1
443 $ touch fix1
444 $ hg -q commit -A -l - << EOF
444 $ hg -q commit -A -l - << EOF
445 > commit 1
445 > commit 1
446 >
446 >
447 > .. fix:: Title of First Fix
447 > .. fix:: Title of First Fix
448 >
448 >
449 > First paragraph of fix 1.
449 > First paragraph of fix 1.
450 > EOF
450 > EOF
451
451
452 $ hg releasenote -r .
452 $ hg releasenote -r .
453 Bug Fixes
453 Bug Fixes
454 =========
454 =========
455
455
456 Title of First Fix
456 Title of First Fix
457 ------------------
457 ------------------
458
458
459 First paragraph of fix 1.
459 First paragraph of fix 1.
460
460
461 $ cd ..
461 $ cd ..
462
462
463 Using multiple admonitions in same changeset
463 Using multiple admonitions in same changeset
464
464
465 $ hg init relnotes-multiadmon
465 $ hg init relnotes-multiadmon
466 $ cd relnotes-multiadmon
466 $ cd relnotes-multiadmon
467
467
468 $ touch file1
468 $ touch file1
469 $ hg -q commit -A -l - << EOF
469 $ hg -q commit -A -l - << EOF
470 > commit 1
470 > commit 1
471 >
471 >
472 > .. feature::
472 > .. feature::
473 >
473 >
474 > Details about new feature.
474 > Details about new feature.
475 >
475 >
476 > .. perf::
476 > .. perf::
477 >
477 >
478 > Improves the execution by 2x
478 > Improves the execution by 2x
479 > EOF
479 > EOF
480
480
481 $ hg releasenotes -r . $TESTTMP/relnotes-multiple-admonitions
481 $ hg releasenotes -r . $TESTTMP/relnotes-multiple-admonitions
482 $ cat $TESTTMP/relnotes-multiple-admonitions
482 $ cat $TESTTMP/relnotes-multiple-admonitions
483 New Features
483 New Features
484 ============
484 ============
485
485
486 * Details about new feature.
486 * Details about new feature.
487
487
488 Performance Improvements
488 Performance Improvements
489 ========================
489 ========================
490
490
491 * Improves the execution by 2x
491 * Improves the execution by 2x
General Comments 0
You need to be logged in to leave comments. Login now