##// END OF EJS Templates
templatekw: reference predecessor node id as {node} in map operation...
Yuya Nishihara -
r32909:89610c58 default
parent child Browse files
Show More
@@ -568,8 +568,8 b' def showpredecessors(repo, ctx, **args):'
568 568 predecessors = sorted(obsutil.closestpredecessors(repo, ctx.node()))
569 569 predecessors = map(hex, predecessors)
570 570
571 return _hybrid(None, predecessors, lambda x: {'predecessor': x},
572 lambda d: d['predecessor'][:12])
571 return _hybrid(None, predecessors, lambda x: {'node': x},
572 lambda d: d['node'][:12])
573 573
574 574 @templatekeyword('p1rev')
575 575 def showp1rev(repo, ctx, templ, **args):
@@ -15,7 +15,8 b' Global setup'
15 15 > tlog = log -G -T '{node|short}\
16 16 > {if(predecessors, "\n Predecessors: {predecessors}")}\
17 17 > {if(predecessors, "\n semi-colon: {join(predecessors, "; ")}")}\
18 > {if(predecessors, "\n json: {predecessors|json}")}\n'
18 > {if(predecessors, "\n json: {predecessors|json}")}\
19 > {if(predecessors, "\n map: {join(predecessors % "{node}", " ")}")}\n'
19 20 > EOF
20 21
21 22 Test templates on amended commit
@@ -72,6 +73,7 b' Predecessors template should show curren'
72 73 | Predecessors: 471f378eab4c
73 74 | semi-colon: 471f378eab4c
74 75 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
76 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
75 77 | @ 471f378eab4c
76 78 |/
77 79 o ea207398892e
@@ -85,6 +87,7 b' Predecessors template should show curren'
85 87 | Predecessors: a468dc9b3633
86 88 | semi-colon: a468dc9b3633
87 89 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
90 | map: a468dc9b36338b14fdb7825f55ce3df4e71517ad
88 91 | @ a468dc9b3633
89 92 |/
90 93 o ea207398892e
@@ -96,10 +99,12 b' with --hidden'
96 99 | Predecessors: a468dc9b3633
97 100 | semi-colon: a468dc9b3633
98 101 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
102 | map: a468dc9b36338b14fdb7825f55ce3df4e71517ad
99 103 | @ a468dc9b3633
100 104 |/ Predecessors: 471f378eab4c
101 105 | semi-colon: 471f378eab4c
102 106 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
107 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
103 108 | x f137d23bb3e1
104 109 | |
105 110 | x 471f378eab4c
@@ -121,10 +126,12 b' visible.'
121 126 | Predecessors: a468dc9b3633
122 127 | semi-colon: a468dc9b3633
123 128 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
129 | map: a468dc9b36338b14fdb7825f55ce3df4e71517ad
124 130 | x a468dc9b3633
125 131 |/ Predecessors: 471f378eab4c
126 132 | semi-colon: 471f378eab4c
127 133 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
134 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
128 135 | x f137d23bb3e1
129 136 | |
130 137 | x 471f378eab4c
@@ -202,10 +209,12 b' Predecessors template should show curren'
202 209 | Predecessors: 471597cad322
203 210 | semi-colon: 471597cad322
204 211 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
212 | map: 471597cad322d1f659bb169751be9133dad92ef3
205 213 o 337fec4d2edc
206 214 | Predecessors: 471597cad322
207 215 | semi-colon: 471597cad322
208 216 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
217 | map: 471597cad322d1f659bb169751be9133dad92ef3
209 218 | @ 471597cad322
210 219 |/
211 220 o ea207398892e
@@ -229,10 +238,12 b' with --hidden'
229 238 | Predecessors: 471597cad322
230 239 | semi-colon: 471597cad322
231 240 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
241 | map: 471597cad322d1f659bb169751be9133dad92ef3
232 242 o 337fec4d2edc
233 243 | Predecessors: 471597cad322
234 244 | semi-colon: 471597cad322
235 245 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
246 | map: 471597cad322d1f659bb169751be9133dad92ef3
236 247 | x 471597cad322
237 248 |/
238 249 o ea207398892e
@@ -312,6 +323,7 b' Predecessors template should show curren'
312 323 | Predecessors: 471f378eab4c
313 324 | semi-colon: 471f378eab4c
314 325 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
326 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
315 327 | @ 471f378eab4c
316 328 |/
317 329 o ea207398892e
@@ -326,6 +338,7 b' displayed'
326 338 | Predecessors: 0dec01379d3b 471f378eab4c
327 339 | semi-colon: 0dec01379d3b; 471f378eab4c
328 340 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
341 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5 471f378eab4c5e25f6c77f785b27c936efb22874
329 342 | @ 0dec01379d3b
330 343 | |
331 344 | x 471f378eab4c
@@ -349,6 +362,7 b' with --hidden'
349 362 | Predecessors: 0dec01379d3b 471f378eab4c
350 363 | semi-colon: 0dec01379d3b; 471f378eab4c
351 364 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
365 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5 471f378eab4c5e25f6c77f785b27c936efb22874
352 366 | x 0dec01379d3b
353 367 | |
354 368 | x 471f378eab4c
@@ -460,10 +474,12 b' Predecessors template should show curren'
460 474 | Predecessors: 471f378eab4c
461 475 | semi-colon: 471f378eab4c
462 476 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
477 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
463 478 | o fdf9bde5129a
464 479 |/ Predecessors: 471f378eab4c
465 480 | semi-colon: 471f378eab4c
466 481 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
482 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
467 483 | @ 471f378eab4c
468 484 |/
469 485 o ea207398892e
@@ -487,14 +503,17 b' Predecessors template should the predece'
487 503 | Predecessors: 65b757b745b9
488 504 | semi-colon: 65b757b745b9
489 505 | json: ["65b757b745b935093c87a2bccd877521cccffcbd"]
506 | map: 65b757b745b935093c87a2bccd877521cccffcbd
490 507 | x 65b757b745b9
491 508 |/ Predecessors: 471f378eab4c
492 509 | semi-colon: 471f378eab4c
493 510 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
511 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
494 512 | @ fdf9bde5129a
495 513 |/ Predecessors: 471f378eab4c
496 514 | semi-colon: 471f378eab4c
497 515 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
516 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
498 517 | x 471f378eab4c
499 518 |/
500 519 o ea207398892e
@@ -588,6 +607,7 b' Predecessors template should show curren'
588 607 | Predecessors: 471f378eab4c
589 608 | semi-colon: 471f378eab4c
590 609 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
610 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
591 611 | @ 471f378eab4c
592 612 |/
593 613 o ea207398892e
@@ -601,6 +621,7 b' Predecessors template should both predec'
601 621 | Predecessors: 0dec01379d3b 471f378eab4c
602 622 | semi-colon: 0dec01379d3b; 471f378eab4c
603 623 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
624 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5 471f378eab4c5e25f6c77f785b27c936efb22874
604 625 | @ 0dec01379d3b
605 626 | |
606 627 | x 471f378eab4c
@@ -616,6 +637,7 b' Predecessors template should both predec'
616 637 | Predecessors: 471f378eab4c b7ea6d14e664
617 638 | semi-colon: 471f378eab4c; b7ea6d14e664
618 639 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
640 | map: 471f378eab4c5e25f6c77f785b27c936efb22874 b7ea6d14e664bdc8922221f7992631b50da3fb07
619 641 | @ b7ea6d14e664
620 642 | |
621 643 | x 471f378eab4c
@@ -638,10 +660,12 b' with --hidden'
638 660 | Predecessors: 471f378eab4c b7ea6d14e664
639 661 | semi-colon: 471f378eab4c; b7ea6d14e664
640 662 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
663 | map: 471f378eab4c5e25f6c77f785b27c936efb22874 b7ea6d14e664bdc8922221f7992631b50da3fb07
641 664 | x b7ea6d14e664
642 665 | | Predecessors: 0dec01379d3b
643 666 | | semi-colon: 0dec01379d3b
644 667 | | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
668 | | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
645 669 | | x 0dec01379d3b
646 670 | |/
647 671 | x 471f378eab4c
@@ -744,6 +768,7 b' Predecessors template should show curren'
744 768 | Predecessors: 471f378eab4c
745 769 | semi-colon: 471f378eab4c
746 770 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
771 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
747 772 | @ 471f378eab4c
748 773 |/
749 774 o ea207398892e
@@ -764,6 +789,7 b' with --hidden'
764 789 | Predecessors: 471f378eab4c
765 790 | semi-colon: 471f378eab4c
766 791 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
792 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
767 793 | x 471f378eab4c
768 794 |/
769 795 o ea207398892e
@@ -807,14 +833,17 b' Check templates'
807 833 | Predecessors: 0dec01379d3b
808 834 | semi-colon: 0dec01379d3b
809 835 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
836 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
810 837 | @ 0dec01379d3b
811 838 | | Predecessors: 471f378eab4c
812 839 | | semi-colon: 471f378eab4c
813 840 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
841 | | map: 471f378eab4c5e25f6c77f785b27c936efb22874
814 842 | x 471f378eab4c
815 843 |/ Predecessors: 0dec01379d3b
816 844 | semi-colon: 0dec01379d3b
817 845 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
846 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
818 847 o ea207398892e
819 848
820 849
@@ -825,6 +854,7 b' Check templates'
825 854 | Predecessors: 471f378eab4c
826 855 | semi-colon: 471f378eab4c
827 856 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
857 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
828 858 | @ 471f378eab4c
829 859 |/
830 860 o ea207398892e
@@ -843,13 +873,16 b' Check templates'
843 873 | Predecessors: 0dec01379d3b
844 874 | semi-colon: 0dec01379d3b
845 875 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
876 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
846 877 | x 0dec01379d3b
847 878 | | Predecessors: 471f378eab4c
848 879 | | semi-colon: 471f378eab4c
849 880 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
881 | | map: 471f378eab4c5e25f6c77f785b27c936efb22874
850 882 | x 471f378eab4c
851 883 |/ Predecessors: 0dec01379d3b
852 884 | semi-colon: 0dec01379d3b
853 885 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
886 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
854 887 @ ea207398892e
855 888
General Comments 0
You need to be logged in to leave comments. Login now