diff mercurial/templates/json/map @ 29381:8bfe44494a0d

templates: add support for filerevision webcommand in json style
author Laura Médioni <laura.medioni@logilab.fr>
date Fri, 03 Jun 2016 12:32:42 +0200
parents c1b526f55116
children e4b777fe1576
line wrap: on
line diff
--- a/mercurial/templates/json/map	Fri Jun 03 11:28:22 2016 +0200
+++ b/mercurial/templates/json/map	Fri Jun 03 12:32:42 2016 +0200
@@ -1,5 +1,20 @@
 mimetype = 'application/json'
-filerevision = '"not yet implemented"'
+filerevision = '\{
+  "node": {node|json},
+  "path": {file|json},
+  "date": {date|json},
+  "desc": {desc|utf8|json},
+  "branch": {if(branch, branch%changesetbranch, "default"|json)},
+  "bookmarks": [{join(bookmarks%changelistentryname, ", ")}],
+  "tags": [{join(tags%changelistentryname, ", ")}],
+  "user": {author|utf8|json},
+  "parents": [{join(parent%changesetparent, ", ")}],
+  "phase": {phase|json},
+  "lines": [{join(text%lineentry, ", ")}]
+  }'
+lineentry = '\{
+  "line": {line|json}
+  }'
 search = '"not yet implemented"'
 # changelog and shortlog are the same web API but with different
 # number of entries.