Mercurial > hg
diff mercurial/templates/json/map @ 28268:3643b66d7f71
hgweb: add index template to json/map
This template allows showing the list of all repos in an hgweb instance (in
hgwebdir mode) as json.
The test has "lastchange" globbed because hgweb uses here file modification
time and not the last commit time.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 27 Feb 2016 19:53:18 +0800 |
parents | d4419c01532b |
children | 94494031f659 |
line wrap: on
line diff
--- a/mercurial/templates/json/map Fri Feb 26 19:13:10 2016 +0000 +++ b/mercurial/templates/json/map Sat Feb 27 19:53:18 2016 +0800 @@ -172,3 +172,12 @@ }' filenodelink = '' filenolink = '' +index = '\{ + "entries": [{join(entries%indexentry, ", ")}] + }' +indexentry = '\{ + "name": {name|utf8|json}, + "description": {description|utf8|json}, + "contact": {contact|utf8|json}, + "lastchange": {lastchange|json} + }'