comparison tests/test-hgweb-commands.t @ 21486:16352b34e32e

hgweb: apply websub filter to the changeset description in rss and atom feeds For example, this is useful for linking from the feed reader to a bug tracker. This follows the existing pattern used within the hgweb templates. With the exception of the raw style, all usages of the changeset "desc" keyword are now followed by either the "firstline" filter or the "websub" filter. When "websub" is used, it always follows the "escape" filter.
author Steven Brown <StevenGBrown@gmail.com>
date Sat, 17 May 2014 17:10:23 +0800
parents ec273709c49e
children cf599f8a2da8
comparison
equal deleted inserted replaced
21485:ec273709c49e 21486:16352b34e32e
34 $ cat > .hg/hgrc <<EOF 34 $ cat > .hg/hgrc <<EOF
35 > [graph] 35 > [graph]
36 > default.width = 3 36 > default.width = 3
37 > stable.width = 3 37 > stable.width = 3
38 > stable.color = FF0000 38 > stable.color = FF0000
39 > [websub]
40 > append = s|(.*)|\1(websub)|
39 > EOF 41 > EOF
40 42
41 $ hg serve --config server.uncompressed=False -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log 43 $ hg serve --config server.uncompressed=False -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
42 $ cat hg.pid >> $DAEMON_PIDS 44 $ cat hg.pid >> $DAEMON_PIDS
43 $ hg log -G --template '{rev}:{node|short} {desc}\n' 45 $ hg log -G --template '{rev}:{node|short} {desc}\n'
96 <th style="text-align:left;">user</th> 98 <th style="text-align:left;">user</th>
97 <td>&#116;&#101;&#115;&#116;</td> 99 <td>&#116;&#101;&#115;&#116;</td>
98 </tr> 100 </tr>
99 <tr> 101 <tr>
100 <th style="text-align:left;vertical-align:top;">description</th> 102 <th style="text-align:left;vertical-align:top;">description</th>
101 <td>branch commit with null character: </td> 103 <td>branch commit with null character: (websub)</td>
102 </tr> 104 </tr>
103 <tr> 105 <tr>
104 <th style="text-align:left;vertical-align:top;">files</th> 106 <th style="text-align:left;vertical-align:top;">files</th>
105 <td></td> 107 <td></td>
106 </tr> 108 </tr>
139 <th style="text-align:left;">user</th> 141 <th style="text-align:left;">user</th>
140 <td>&#116;&#101;&#115;&#116;</td> 142 <td>&#116;&#101;&#115;&#116;</td>
141 </tr> 143 </tr>
142 <tr> 144 <tr>
143 <th style="text-align:left;vertical-align:top;">description</th> 145 <th style="text-align:left;vertical-align:top;">description</th>
144 <td>branch</td> 146 <td>branch(websub)</td>
145 </tr> 147 </tr>
146 <tr> 148 <tr>
147 <th style="text-align:left;vertical-align:top;">files</th> 149 <th style="text-align:left;vertical-align:top;">files</th>
148 <td>foo<br /></td> 150 <td>foo<br /></td>
149 </tr> 151 </tr>
182 <th style="text-align:left;">user</th> 184 <th style="text-align:left;">user</th>
183 <td>&#116;&#101;&#115;&#116;</td> 185 <td>&#116;&#101;&#115;&#116;</td>
184 </tr> 186 </tr>
185 <tr> 187 <tr>
186 <th style="text-align:left;vertical-align:top;">description</th> 188 <th style="text-align:left;vertical-align:top;">description</th>
187 <td>Added tag 1.0 for changeset 2ef0ac749a14</td> 189 <td>Added tag 1.0 for changeset 2ef0ac749a14(websub)</td>
188 </tr> 190 </tr>
189 <tr> 191 <tr>
190 <th style="text-align:left;vertical-align:top;">files</th> 192 <th style="text-align:left;vertical-align:top;">files</th>
191 <td>.hgtags<br /></td> 193 <td>.hgtags<br /></td>
192 </tr> 194 </tr>
225 <th style="text-align:left;">user</th> 227 <th style="text-align:left;">user</th>
226 <td>&#116;&#101;&#115;&#116;</td> 228 <td>&#116;&#101;&#115;&#116;</td>
227 </tr> 229 </tr>
228 <tr> 230 <tr>
229 <th style="text-align:left;vertical-align:top;">description</th> 231 <th style="text-align:left;vertical-align:top;">description</th>
230 <td>base</td> 232 <td>base(websub)</td>
231 </tr> 233 </tr>
232 <tr> 234 <tr>
233 <th style="text-align:left;vertical-align:top;">files</th> 235 <th style="text-align:left;vertical-align:top;">files</th>
234 <td>da/foo<br />foo<br /></td> 236 <td>da/foo<br />foo<br /></td>
235 </tr> 237 </tr>
276 <th style="text-align:left;vertical-align:top;">user</th> 278 <th style="text-align:left;vertical-align:top;">user</th>
277 <td>&#116;&#101;&#115;&#116;</td> 279 <td>&#116;&#101;&#115;&#116;</td>
278 </tr> 280 </tr>
279 <tr> 281 <tr>
280 <th style="text-align:left;vertical-align:top;">description</th> 282 <th style="text-align:left;vertical-align:top;">description</th>
281 <td>branch commit with null character: </td> 283 <td>branch commit with null character: (websub)</td>
282 </tr> 284 </tr>
283 <tr> 285 <tr>
284 <th style="text-align:left;vertical-align:top;">files</th> 286 <th style="text-align:left;vertical-align:top;">files</th>
285 <td></td> 287 <td></td>
286 </tr> 288 </tr>
316 <th style="text-align:left;vertical-align:top;">user</th> 318 <th style="text-align:left;vertical-align:top;">user</th>
317 <td>&#116;&#101;&#115;&#116;</td> 319 <td>&#116;&#101;&#115;&#116;</td>
318 </tr> 320 </tr>
319 <tr> 321 <tr>
320 <th style="text-align:left;vertical-align:top;">description</th> 322 <th style="text-align:left;vertical-align:top;">description</th>
321 <td>branch</td> 323 <td>branch(websub)</td>
322 </tr> 324 </tr>
323 <tr> 325 <tr>
324 <th style="text-align:left;vertical-align:top;">files</th> 326 <th style="text-align:left;vertical-align:top;">files</th>
325 <td>foo<br /></td> 327 <td>foo<br /></td>
326 </tr> 328 </tr>
356 <th style="text-align:left;vertical-align:top;">user</th> 358 <th style="text-align:left;vertical-align:top;">user</th>
357 <td>&#116;&#101;&#115;&#116;</td> 359 <td>&#116;&#101;&#115;&#116;</td>
358 </tr> 360 </tr>
359 <tr> 361 <tr>
360 <th style="text-align:left;vertical-align:top;">description</th> 362 <th style="text-align:left;vertical-align:top;">description</th>
361 <td>Added tag 1.0 for changeset 2ef0ac749a14</td> 363 <td>Added tag 1.0 for changeset 2ef0ac749a14(websub)</td>
362 </tr> 364 </tr>
363 <tr> 365 <tr>
364 <th style="text-align:left;vertical-align:top;">files</th> 366 <th style="text-align:left;vertical-align:top;">files</th>
365 <td>.hgtags<br /></td> 367 <td>.hgtags<br /></td>
366 </tr> 368 </tr>
396 <th style="text-align:left;vertical-align:top;">user</th> 398 <th style="text-align:left;vertical-align:top;">user</th>
397 <td>&#116;&#101;&#115;&#116;</td> 399 <td>&#116;&#101;&#115;&#116;</td>
398 </tr> 400 </tr>
399 <tr> 401 <tr>
400 <th style="text-align:left;vertical-align:top;">description</th> 402 <th style="text-align:left;vertical-align:top;">description</th>
401 <td>base</td> 403 <td>base(websub)</td>
402 </tr> 404 </tr>
403 <tr> 405 <tr>
404 <th style="text-align:left;vertical-align:top;">files</th> 406 <th style="text-align:left;vertical-align:top;">files</th>
405 <td>da/foo<br />foo<br /></td> 407 <td>da/foo<br />foo<br /></td>
406 </tr> 408 </tr>
456 <th style="text-align:left;">user</th> 458 <th style="text-align:left;">user</th>
457 <td>&#116;&#101;&#115;&#116;</td> 459 <td>&#116;&#101;&#115;&#116;</td>
458 </tr> 460 </tr>
459 <tr> 461 <tr>
460 <th style="text-align:left;vertical-align:top;">description</th> 462 <th style="text-align:left;vertical-align:top;">description</th>
461 <td>Added tag 1.0 for changeset 2ef0ac749a14</td> 463 <td>Added tag 1.0 for changeset 2ef0ac749a14(websub)</td>
462 </tr> 464 </tr>
463 <tr> 465 <tr>
464 <th style="text-align:left;vertical-align:top;">files</th> 466 <th style="text-align:left;vertical-align:top;">files</th>
465 <td>.hgtags<br /></td> 467 <td>.hgtags<br /></td>
466 </tr> 468 </tr>
499 <th style="text-align:left;">user</th> 501 <th style="text-align:left;">user</th>
500 <td>&#116;&#101;&#115;&#116;</td> 502 <td>&#116;&#101;&#115;&#116;</td>
501 </tr> 503 </tr>
502 <tr> 504 <tr>
503 <th style="text-align:left;vertical-align:top;">description</th> 505 <th style="text-align:left;vertical-align:top;">description</th>
504 <td>base</td> 506 <td>base(websub)</td>
505 </tr> 507 </tr>
506 <tr> 508 <tr>
507 <th style="text-align:left;vertical-align:top;">files</th> 509 <th style="text-align:left;vertical-align:top;">files</th>
508 <td>da/foo<br />foo<br /></td> 510 <td>da/foo<br />foo<br /></td>
509 </tr> 511 </tr>
550 <th style="text-align:left;vertical-align:top;">user</th> 552 <th style="text-align:left;vertical-align:top;">user</th>
551 <td>&#116;&#101;&#115;&#116;</td> 553 <td>&#116;&#101;&#115;&#116;</td>
552 </tr> 554 </tr>
553 <tr> 555 <tr>
554 <th style="text-align:left;vertical-align:top;">description</th> 556 <th style="text-align:left;vertical-align:top;">description</th>
555 <td>Added tag 1.0 for changeset 2ef0ac749a14</td> 557 <td>Added tag 1.0 for changeset 2ef0ac749a14(websub)</td>
556 </tr> 558 </tr>
557 <tr> 559 <tr>
558 <th style="text-align:left;vertical-align:top;">files</th> 560 <th style="text-align:left;vertical-align:top;">files</th>
559 <td>.hgtags<br /></td> 561 <td>.hgtags<br /></td>
560 </tr> 562 </tr>
590 <th style="text-align:left;vertical-align:top;">user</th> 592 <th style="text-align:left;vertical-align:top;">user</th>
591 <td>&#116;&#101;&#115;&#116;</td> 593 <td>&#116;&#101;&#115;&#116;</td>
592 </tr> 594 </tr>
593 <tr> 595 <tr>
594 <th style="text-align:left;vertical-align:top;">description</th> 596 <th style="text-align:left;vertical-align:top;">description</th>
595 <td>base</td> 597 <td>base(websub)</td>
596 </tr> 598 </tr>
597 <tr> 599 <tr>
598 <th style="text-align:left;vertical-align:top;">files</th> 600 <th style="text-align:left;vertical-align:top;">files</th>
599 <td>da/foo<br />foo<br /></td> 601 <td>da/foo<br />foo<br /></td>
600 </tr> 602 </tr>
648 <th style="text-align:left;">user</th> 650 <th style="text-align:left;">user</th>
649 <td>&#116;&#101;&#115;&#116;</td> 651 <td>&#116;&#101;&#115;&#116;</td>
650 </tr> 652 </tr>
651 <tr> 653 <tr>
652 <th style="text-align:left;vertical-align:top;">description</th> 654 <th style="text-align:left;vertical-align:top;">description</th>
653 <td>base</td> 655 <td>base(websub)</td>
654 </tr> 656 </tr>
655 <tr> 657 <tr>
656 <th style="text-align:left;vertical-align:top;">files</th> 658 <th style="text-align:left;vertical-align:top;">files</th>
657 <td></td> 659 <td></td>
658 </tr> 660 </tr>
673 <title>test: foo history</title> 675 <title>test: foo history</title>
674 <description>foo revision history</description> 676 <description>foo revision history</description>
675 <item> 677 <item>
676 <title>base</title> 678 <title>base</title>
677 <link>http://*:$HGPORT/log2ef0ac749a14/foo</link> (glob) 679 <link>http://*:$HGPORT/log2ef0ac749a14/foo</link> (glob)
678 <description><![CDATA[base]]></description> 680 <description><![CDATA[base(websub)]]></description>
679 <author>&#116;&#101;&#115;&#116;</author> 681 <author>&#116;&#101;&#115;&#116;</author>
680 <pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 682 <pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
681 </item> 683 </item>
682 684
683 </channel> 685 </channel>
860 <p><input name="rev" id="search1" type="text" size="30" /></p> 862 <p><input name="rev" id="search1" type="text" size="30" /></p>
861 <div id="hint">Find changesets by keywords (author, files, the commit message), revision 863 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
862 number or hash, or <a href="/help/revsets">revset expression</a>.</div> 864 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
863 </form> 865 </form>
864 866
865 <div class="description">base</div> 867 <div class="description">base(websub)</div>
866 868
867 <table id="changesetEntry"> 869 <table id="changesetEntry">
868 <tr> 870 <tr>
869 <th class="author">author</th> 871 <th class="author">author</th>
870 <td class="author">&#116;&#101;&#115;&#116;</td> 872 <td class="author">&#116;&#101;&#115;&#116;</td>
1282 <p><input name="rev" id="search1" type="text" size="30" /></p> 1284 <p><input name="rev" id="search1" type="text" size="30" /></p>
1283 <div id="hint">Find changesets by keywords (author, files, the commit message), revision 1285 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1284 number or hash, or <a href="/help/revsets">revset expression</a>.</div> 1286 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1285 </form> 1287 </form>
1286 1288
1287 <div class="description">Added tag 1.0 for changeset 2ef0ac749a14</div> 1289 <div class="description">Added tag 1.0 for changeset 2ef0ac749a14(websub)</div>
1288 1290
1289 <table id="changesetEntry"> 1291 <table id="changesetEntry">
1290 <tr> 1292 <tr>
1291 <th class="author">author</th> 1293 <th class="author">author</th>
1292 <td class="author">&#116;&#101;&#115;&#116;</td> 1294 <td class="author">&#116;&#101;&#115;&#116;</td>
1406 <p><input name="rev" id="search1" type="text" size="30" /></p> 1408 <p><input name="rev" id="search1" type="text" size="30" /></p>
1407 <div id="hint">Find changesets by keywords (author, files, the commit message), revision 1409 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1408 number or hash, or <a href="/help/revsets">revset expression</a>.</div> 1410 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1409 </form> 1411 </form>
1410 1412
1411 <div class="description">branch</div> 1413 <div class="description">branch(websub)</div>
1412 1414
1413 <table id="changesetEntry"> 1415 <table id="changesetEntry">
1414 <tr> 1416 <tr>
1415 <th class="author">author</th> 1417 <th class="author">author</th>
1416 <td class="author">&#116;&#101;&#115;&#116;</td> 1418 <td class="author">&#116;&#101;&#115;&#116;</td>