--- a/ChangeLog Mon Nov 02 23:06:08 2020 -0600
+++ b/ChangeLog Tue Nov 03 00:16:25 2020 -0600
@@ -1,11 +1,14 @@
+ * A real working solution for http_clone_url. Sean Farley * Gave up on making http_clone_url smart and instead add an additional
http_base_url and let the templates figure out what to do.
* Tweak the http_clone_path keyword.
* Added full support for http_base_url and http_clone_url.
* Beta support for titles and subtitles.
--- a/src/hgwebplus.py Mon Nov 02 23:06:08 2020 -0600
+++ b/src/hgwebplus.py Tue Nov 03 00:16:25 2020 -0600
@@ -252,9 +252,15 @@
easier for users to clone repositories.
- ui = context.resource(mapping, b'ui')
+ urlbase = context.symbol(mapping, b'urlbase') + if urlbase.endswith(b'/'): - return ui.config(b'web', b'http_clone_url', b'')
+ path = context.symbol(mapping, b'url') + if path.startswith(b'/'): + return urlbase + b'/' + path def http_base_url(context, mapping):
@@ -346,8 +352,7 @@
templatekeyword = registrar.templatekeyword(templater._proc._defaults)
- templatekeyword(b'http_clone_url', requires={b'ui'})(http_clone_url)
- templatekeyword(b'http_base_url', requires={b'ui'})(http_base_url)
+ templatekeyword(b'http_clone_url', requires=())(http_clone_url) templatekeyword(b'readme', requires={b'ctx', b'repo'})(readme)
templatekeyword(b'ssh_clone_url', requires={b'ui', b'repo'})(ssh_clone_url)