[PATCH 4 of 4] json: implement {help} template

Gregory Szorc gregory.szorc at gmail.com
Thu Apr 2 00:42:01 CDT 2015


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1427952243 25200
#      Wed Apr 01 22:24:03 2015 -0700
# Node ID 55772966391b9a46d0776bd5d63f5c74f48f2ce0
# Parent  3628b37009759831113fb8905baea4c27d048e07
json: implement {help} template

We should consider add HTML rendering of the RST into the response as a
follow-up. I attempted to do this, but there was an empty array
returned by the rstdoc() template function. Not sure what's going on.
Will deal with it later.

diff --git a/mercurial/templates/json/map b/mercurial/templates/json/map
--- a/mercurial/templates/json/map
+++ b/mercurial/templates/json/map
@@ -91,7 +91,10 @@ helptopics = '\{
 helptopicentry = '\{
   "topic": {topic|json},
   "summary": {summary|json}
   }'
-help = '"not yet implemented"'
+help = '\{
+  "topic": {topic|json},
+  "rawdoc": {doc|json}
+  }'
 filenodelink = ''
 filenolink = ''
diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t
--- a/tests/test-hgweb-json.t
+++ b/tests/test-hgweb-json.t
@@ -1002,5 +1002,8 @@ help/{topic} shows an individual help to
 
   $ request json-help/phases
   200 Script output follows
   
-  "not yet implemented"
+  {
+    "rawdoc": "Working with Phases\n*", (glob)
+    "topic": "phases"
+  }


More information about the Mercurial-devel mailing list