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