[PATCH 2 of 2] hgweb: add absolute urls for archives in json-summary

Anton Shestakov av6 at dwimlabs.net
Fri Jul 1 02:35:06 EDT 2016


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1467352475 -28800
#      Fri Jul 01 13:54:35 2016 +0800
# Node ID 4c4cad87708e3b662e22ae1acbe2e33836d54f9b
# Parent  320ebd166cd77ccd74aa0038a2a342888dbd4670
hgweb: add absolute urls for archives in json-summary

diff --git a/mercurial/templates/json/map b/mercurial/templates/json/map
--- a/mercurial/templates/json/map
+++ b/mercurial/templates/json/map
@@ -114,7 +114,8 @@ summary = '\{
 archiveentry = '\{
   "node": {node|json},
   "extension": {extension|json},
-  "type": {type|json}
+  "type": {type|json},
+  "url": {"{urlbase}{url}archive/{node}{extension}"|json}
   }'
 filediff = '\{
   "path": {file|json},
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
@@ -806,7 +806,8 @@ summary/ shows a summary of repository s
       {
         "extension": ".tar.bz2",
         "node": "tip",
-        "type": "bz2"
+        "type": "bz2",
+        "url": "http://*:$HGPORT/archive/tip.tar.bz2" (glob)
       }
     ],
     "bookmarks": [


More information about the Mercurial-devel mailing list