##// END OF EJS Templates
templatekw: populate all keywords depending on predecessor in map operation...
Yuya Nishihara -
r32910:498e9dcc default
parent child Browse files
Show More
@@ -568,8 +568,9 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: {'node': x},
571 return _hybrid(None, predecessors,
572 lambda d: d['node'][:12])
572 lambda x: {'ctx': repo[x], 'revcache': {}},
573 lambda d: short(scmutil.binnode(d['ctx'])))
573
574
574 @templatekeyword('p1rev')
575 @templatekeyword('p1rev')
575 def showp1rev(repo, ctx, templ, **args):
576 def showp1rev(repo, ctx, templ, **args):
@@ -16,7 +16,7 b' Global setup'
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}")}\
18 > {if(predecessors, "\n json: {predecessors|json}")}\
19 > {if(predecessors, "\n map: {join(predecessors % "{node}", " ")}")}\n'
19 > {if(predecessors, "\n map: {join(predecessors % "{rev}:{node}", " ")}")}\n'
20 > EOF
20 > EOF
21
21
22 Test templates on amended commit
22 Test templates on amended commit
@@ -73,7 +73,7 b' Predecessors template should show curren'
73 | Predecessors: 471f378eab4c
73 | Predecessors: 471f378eab4c
74 | semi-colon: 471f378eab4c
74 | semi-colon: 471f378eab4c
75 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
75 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
76 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
76 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
77 | @ 471f378eab4c
77 | @ 471f378eab4c
78 |/
78 |/
79 o ea207398892e
79 o ea207398892e
@@ -87,7 +87,7 b' Predecessors template should show curren'
87 | Predecessors: a468dc9b3633
87 | Predecessors: a468dc9b3633
88 | semi-colon: a468dc9b3633
88 | semi-colon: a468dc9b3633
89 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
89 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
90 | map: a468dc9b36338b14fdb7825f55ce3df4e71517ad
90 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
91 | @ a468dc9b3633
91 | @ a468dc9b3633
92 |/
92 |/
93 o ea207398892e
93 o ea207398892e
@@ -99,12 +99,12 b' with --hidden'
99 | Predecessors: a468dc9b3633
99 | Predecessors: a468dc9b3633
100 | semi-colon: a468dc9b3633
100 | semi-colon: a468dc9b3633
101 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
101 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
102 | map: a468dc9b36338b14fdb7825f55ce3df4e71517ad
102 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
103 | @ a468dc9b3633
103 | @ a468dc9b3633
104 |/ Predecessors: 471f378eab4c
104 |/ Predecessors: 471f378eab4c
105 | semi-colon: 471f378eab4c
105 | semi-colon: 471f378eab4c
106 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
106 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
107 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
107 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
108 | x f137d23bb3e1
108 | x f137d23bb3e1
109 | |
109 | |
110 | x 471f378eab4c
110 | x 471f378eab4c
@@ -126,12 +126,12 b' visible.'
126 | Predecessors: a468dc9b3633
126 | Predecessors: a468dc9b3633
127 | semi-colon: a468dc9b3633
127 | semi-colon: a468dc9b3633
128 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
128 | json: ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]
129 | map: a468dc9b36338b14fdb7825f55ce3df4e71517ad
129 | map: 3:a468dc9b36338b14fdb7825f55ce3df4e71517ad
130 | x a468dc9b3633
130 | x a468dc9b3633
131 |/ Predecessors: 471f378eab4c
131 |/ Predecessors: 471f378eab4c
132 | semi-colon: 471f378eab4c
132 | semi-colon: 471f378eab4c
133 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
133 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
134 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
134 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
135 | x f137d23bb3e1
135 | x f137d23bb3e1
136 | |
136 | |
137 | x 471f378eab4c
137 | x 471f378eab4c
@@ -209,12 +209,12 b' Predecessors template should show curren'
209 | Predecessors: 471597cad322
209 | Predecessors: 471597cad322
210 | semi-colon: 471597cad322
210 | semi-colon: 471597cad322
211 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
211 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
212 | map: 471597cad322d1f659bb169751be9133dad92ef3
212 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
213 o 337fec4d2edc
213 o 337fec4d2edc
214 | Predecessors: 471597cad322
214 | Predecessors: 471597cad322
215 | semi-colon: 471597cad322
215 | semi-colon: 471597cad322
216 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
216 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
217 | map: 471597cad322d1f659bb169751be9133dad92ef3
217 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
218 | @ 471597cad322
218 | @ 471597cad322
219 |/
219 |/
220 o ea207398892e
220 o ea207398892e
@@ -238,12 +238,12 b' with --hidden'
238 | Predecessors: 471597cad322
238 | Predecessors: 471597cad322
239 | semi-colon: 471597cad322
239 | semi-colon: 471597cad322
240 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
240 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
241 | map: 471597cad322d1f659bb169751be9133dad92ef3
241 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
242 o 337fec4d2edc
242 o 337fec4d2edc
243 | Predecessors: 471597cad322
243 | Predecessors: 471597cad322
244 | semi-colon: 471597cad322
244 | semi-colon: 471597cad322
245 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
245 | json: ["471597cad322d1f659bb169751be9133dad92ef3"]
246 | map: 471597cad322d1f659bb169751be9133dad92ef3
246 | map: 1:471597cad322d1f659bb169751be9133dad92ef3
247 | x 471597cad322
247 | x 471597cad322
248 |/
248 |/
249 o ea207398892e
249 o ea207398892e
@@ -323,7 +323,7 b' Predecessors template should show curren'
323 | Predecessors: 471f378eab4c
323 | Predecessors: 471f378eab4c
324 | semi-colon: 471f378eab4c
324 | semi-colon: 471f378eab4c
325 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
325 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
326 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
326 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
327 | @ 471f378eab4c
327 | @ 471f378eab4c
328 |/
328 |/
329 o ea207398892e
329 o ea207398892e
@@ -338,7 +338,7 b' displayed'
338 | Predecessors: 0dec01379d3b 471f378eab4c
338 | Predecessors: 0dec01379d3b 471f378eab4c
339 | semi-colon: 0dec01379d3b; 471f378eab4c
339 | semi-colon: 0dec01379d3b; 471f378eab4c
340 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
340 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
341 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5 471f378eab4c5e25f6c77f785b27c936efb22874
341 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
342 | @ 0dec01379d3b
342 | @ 0dec01379d3b
343 | |
343 | |
344 | x 471f378eab4c
344 | x 471f378eab4c
@@ -362,7 +362,7 b' with --hidden'
362 | Predecessors: 0dec01379d3b 471f378eab4c
362 | Predecessors: 0dec01379d3b 471f378eab4c
363 | semi-colon: 0dec01379d3b; 471f378eab4c
363 | semi-colon: 0dec01379d3b; 471f378eab4c
364 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
364 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
365 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5 471f378eab4c5e25f6c77f785b27c936efb22874
365 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
366 | x 0dec01379d3b
366 | x 0dec01379d3b
367 | |
367 | |
368 | x 471f378eab4c
368 | x 471f378eab4c
@@ -474,12 +474,12 b' Predecessors template should show curren'
474 | Predecessors: 471f378eab4c
474 | Predecessors: 471f378eab4c
475 | semi-colon: 471f378eab4c
475 | semi-colon: 471f378eab4c
476 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
476 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
477 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
477 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
478 | o fdf9bde5129a
478 | o fdf9bde5129a
479 |/ Predecessors: 471f378eab4c
479 |/ Predecessors: 471f378eab4c
480 | semi-colon: 471f378eab4c
480 | semi-colon: 471f378eab4c
481 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
481 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
482 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
482 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
483 | @ 471f378eab4c
483 | @ 471f378eab4c
484 |/
484 |/
485 o ea207398892e
485 o ea207398892e
@@ -503,17 +503,17 b' Predecessors template should the predece'
503 | Predecessors: 65b757b745b9
503 | Predecessors: 65b757b745b9
504 | semi-colon: 65b757b745b9
504 | semi-colon: 65b757b745b9
505 | json: ["65b757b745b935093c87a2bccd877521cccffcbd"]
505 | json: ["65b757b745b935093c87a2bccd877521cccffcbd"]
506 | map: 65b757b745b935093c87a2bccd877521cccffcbd
506 | map: 3:65b757b745b935093c87a2bccd877521cccffcbd
507 | x 65b757b745b9
507 | x 65b757b745b9
508 |/ Predecessors: 471f378eab4c
508 |/ Predecessors: 471f378eab4c
509 | semi-colon: 471f378eab4c
509 | semi-colon: 471f378eab4c
510 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
510 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
511 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
511 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
512 | @ fdf9bde5129a
512 | @ fdf9bde5129a
513 |/ Predecessors: 471f378eab4c
513 |/ Predecessors: 471f378eab4c
514 | semi-colon: 471f378eab4c
514 | semi-colon: 471f378eab4c
515 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
515 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
516 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
516 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
517 | x 471f378eab4c
517 | x 471f378eab4c
518 |/
518 |/
519 o ea207398892e
519 o ea207398892e
@@ -607,7 +607,7 b' Predecessors template should show curren'
607 | Predecessors: 471f378eab4c
607 | Predecessors: 471f378eab4c
608 | semi-colon: 471f378eab4c
608 | semi-colon: 471f378eab4c
609 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
609 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
610 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
610 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
611 | @ 471f378eab4c
611 | @ 471f378eab4c
612 |/
612 |/
613 o ea207398892e
613 o ea207398892e
@@ -621,7 +621,7 b' Predecessors template should both predec'
621 | Predecessors: 0dec01379d3b 471f378eab4c
621 | Predecessors: 0dec01379d3b 471f378eab4c
622 | semi-colon: 0dec01379d3b; 471f378eab4c
622 | semi-colon: 0dec01379d3b; 471f378eab4c
623 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
623 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5", "471f378eab4c5e25f6c77f785b27c936efb22874"]
624 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5 471f378eab4c5e25f6c77f785b27c936efb22874
624 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5 1:471f378eab4c5e25f6c77f785b27c936efb22874
625 | @ 0dec01379d3b
625 | @ 0dec01379d3b
626 | |
626 | |
627 | x 471f378eab4c
627 | x 471f378eab4c
@@ -637,7 +637,7 b' Predecessors template should both predec'
637 | Predecessors: 471f378eab4c b7ea6d14e664
637 | Predecessors: 471f378eab4c b7ea6d14e664
638 | semi-colon: 471f378eab4c; b7ea6d14e664
638 | semi-colon: 471f378eab4c; b7ea6d14e664
639 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
639 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
640 | map: 471f378eab4c5e25f6c77f785b27c936efb22874 b7ea6d14e664bdc8922221f7992631b50da3fb07
640 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07
641 | @ b7ea6d14e664
641 | @ b7ea6d14e664
642 | |
642 | |
643 | x 471f378eab4c
643 | x 471f378eab4c
@@ -660,12 +660,12 b' with --hidden'
660 | Predecessors: 471f378eab4c b7ea6d14e664
660 | Predecessors: 471f378eab4c b7ea6d14e664
661 | semi-colon: 471f378eab4c; b7ea6d14e664
661 | semi-colon: 471f378eab4c; b7ea6d14e664
662 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
662 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874", "b7ea6d14e664bdc8922221f7992631b50da3fb07"]
663 | map: 471f378eab4c5e25f6c77f785b27c936efb22874 b7ea6d14e664bdc8922221f7992631b50da3fb07
663 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874 3:b7ea6d14e664bdc8922221f7992631b50da3fb07
664 | x b7ea6d14e664
664 | x b7ea6d14e664
665 | | Predecessors: 0dec01379d3b
665 | | Predecessors: 0dec01379d3b
666 | | semi-colon: 0dec01379d3b
666 | | semi-colon: 0dec01379d3b
667 | | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
667 | | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
668 | | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
668 | | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
669 | | x 0dec01379d3b
669 | | x 0dec01379d3b
670 | |/
670 | |/
671 | x 471f378eab4c
671 | x 471f378eab4c
@@ -768,7 +768,7 b' Predecessors template should show curren'
768 | Predecessors: 471f378eab4c
768 | Predecessors: 471f378eab4c
769 | semi-colon: 471f378eab4c
769 | semi-colon: 471f378eab4c
770 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
770 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
771 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
771 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
772 | @ 471f378eab4c
772 | @ 471f378eab4c
773 |/
773 |/
774 o ea207398892e
774 o ea207398892e
@@ -789,7 +789,7 b' with --hidden'
789 | Predecessors: 471f378eab4c
789 | Predecessors: 471f378eab4c
790 | semi-colon: 471f378eab4c
790 | semi-colon: 471f378eab4c
791 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
791 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
792 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
792 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
793 | x 471f378eab4c
793 | x 471f378eab4c
794 |/
794 |/
795 o ea207398892e
795 o ea207398892e
@@ -833,17 +833,17 b' Check templates'
833 | Predecessors: 0dec01379d3b
833 | Predecessors: 0dec01379d3b
834 | semi-colon: 0dec01379d3b
834 | semi-colon: 0dec01379d3b
835 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
835 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
836 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
836 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
837 | @ 0dec01379d3b
837 | @ 0dec01379d3b
838 | | Predecessors: 471f378eab4c
838 | | Predecessors: 471f378eab4c
839 | | semi-colon: 471f378eab4c
839 | | semi-colon: 471f378eab4c
840 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
840 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
841 | | map: 471f378eab4c5e25f6c77f785b27c936efb22874
841 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
842 | x 471f378eab4c
842 | x 471f378eab4c
843 |/ Predecessors: 0dec01379d3b
843 |/ Predecessors: 0dec01379d3b
844 | semi-colon: 0dec01379d3b
844 | semi-colon: 0dec01379d3b
845 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
845 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
846 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
846 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
847 o ea207398892e
847 o ea207398892e
848
848
849
849
@@ -854,7 +854,7 b' Check templates'
854 | Predecessors: 471f378eab4c
854 | Predecessors: 471f378eab4c
855 | semi-colon: 471f378eab4c
855 | semi-colon: 471f378eab4c
856 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
856 | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
857 | map: 471f378eab4c5e25f6c77f785b27c936efb22874
857 | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
858 | @ 471f378eab4c
858 | @ 471f378eab4c
859 |/
859 |/
860 o ea207398892e
860 o ea207398892e
@@ -873,16 +873,16 b' Check templates'
873 | Predecessors: 0dec01379d3b
873 | Predecessors: 0dec01379d3b
874 | semi-colon: 0dec01379d3b
874 | semi-colon: 0dec01379d3b
875 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
875 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
876 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
876 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
877 | x 0dec01379d3b
877 | x 0dec01379d3b
878 | | Predecessors: 471f378eab4c
878 | | Predecessors: 471f378eab4c
879 | | semi-colon: 471f378eab4c
879 | | semi-colon: 471f378eab4c
880 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
880 | | json: ["471f378eab4c5e25f6c77f785b27c936efb22874"]
881 | | map: 471f378eab4c5e25f6c77f785b27c936efb22874
881 | | map: 1:471f378eab4c5e25f6c77f785b27c936efb22874
882 | x 471f378eab4c
882 | x 471f378eab4c
883 |/ Predecessors: 0dec01379d3b
883 |/ Predecessors: 0dec01379d3b
884 | semi-colon: 0dec01379d3b
884 | semi-colon: 0dec01379d3b
885 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
885 | json: ["0dec01379d3be6318c470ead31b1fe7ae7cb53d5"]
886 | map: 0dec01379d3be6318c470ead31b1fe7ae7cb53d5
886 | map: 2:0dec01379d3be6318c470ead31b1fe7ae7cb53d5
887 @ ea207398892e
887 @ ea207398892e
888
888
General Comments 0
You need to be logged in to leave comments. Login now