comparison tests/test-branches.t @ 32968:5100ce217dfa

formatter: add support for separator template This seems useful for writing JSON template.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 22 Apr 2017 21:50:51 +0900
parents 13eebc189ff3
children 61b60b28c381
comparison
equal deleted inserted replaced
32967:13eebc189ff3 32968:5100ce217dfa
531 default: Adding root node 531 default: Adding root node
532 532
533 $ cat <<'EOF' > "$TESTTMP/map-myjson" 533 $ cat <<'EOF' > "$TESTTMP/map-myjson"
534 > docheader = '\{\n' 534 > docheader = '\{\n'
535 > docfooter = '\n}\n' 535 > docfooter = '\n}\n'
536 > branches = '{ifeq(index, 0, "", ",\n")} {dict(branch, node|short)|json}' 536 > separator = ',\n'
537 > branches = ' {dict(branch, node|short)|json}'
537 > EOF 538 > EOF
538 $ hg branches -T "$TESTTMP/map-myjson" 539 $ hg branches -T "$TESTTMP/map-myjson"
539 { 540 {
540 {"branch": "b", "node": "e23b5505d1ad"}, 541 {"branch": "b", "node": "e23b5505d1ad"},
541 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob) 542 {"branch": "a branch *", "node": "10ff5895aa57"}, (glob)