##// END OF EJS Templates
branches: include active, closed and current flags in template output
Yuya Nishihara -
r22705:d4869b28 default
parent child Browse files
Show More
@@ -1116,7 +1116,8 b' def branches(ui, repo, active=False, clo'
1116 1116 else:
1117 1117 label = 'branches.inactive'
1118 1118 notice = _(' (inactive)')
1119 if tag == repo.dirstate.branch():
1119 current = (tag == repo.dirstate.branch())
1120 if current:
1120 1121 label = 'branches.current'
1121 1122
1122 1123 fm.startitem()
@@ -1126,6 +1127,7 b' def branches(ui, repo, active=False, clo'
1126 1127 fmt = ' ' * padsize + ' %d:%s'
1127 1128 fm.condwrite(not ui.quiet, 'rev node', fmt, rev, hexfunc(ctx.node()),
1128 1129 label='log.changeset changeset.%s' % ctx.phasestr())
1130 fm.data(active=isactive, closed=not isopen, current=current)
1129 1131 if not ui.quiet:
1130 1132 fm.plain(notice)
1131 1133 fm.plain('\n')
@@ -475,27 +475,42 b' template output:'
475 475 $ hg branches -Tjson --closed
476 476 [
477 477 {
478 "active": true,
478 479 "branch": "b",
480 "closed": false,
481 "current": true,
479 482 "node": "e23b5505d1ad24aab6f84fd8c7cb8cd8e5e93be0",
480 483 "rev": 13
481 484 },
482 485 {
486 "active": true,
483 487 "branch": "a branch name much longer than the default justification used by branches",
488 "closed": false,
489 "current": false,
484 490 "node": "10ff5895aa5793bd378da574af8cec8ea408d831",
485 491 "rev": 7
486 492 },
487 493 {
494 "active": false,
488 495 "branch": "c",
496 "closed": true,
497 "current": false,
489 498 "node": "f894c25619d3f1484639d81be950e0a07bc6f1f6",
490 499 "rev": 14
491 500 },
492 501 {
502 "active": false,
493 503 "branch": "a",
504 "closed": false,
505 "current": false,
494 506 "node": "d8cbc61dbaa6dc817175d1e301eecb863f280832",
495 507 "rev": 5
496 508 },
497 509 {
510 "active": false,
498 511 "branch": "default",
512 "closed": false,
513 "current": false,
499 514 "node": "19709c5a4e75bf938f8e349aff97438539bb729e",
500 515 "rev": 0
501 516 }
General Comments 0
You need to be logged in to leave comments. Login now