--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -744,13 +744,9 @@ class hgweb(object):
style = req.form['style'][0]
mapfile = style_map(self.templatepath, style)
- if not req.url:
- port = req.env["SERVER_PORT"]
- port = port != "80" and (":" + port) or ""
- uri = req.env["REQUEST_URI"]
- if "?" in uri:
- uri = uri.split("?")[0]
- req.url = "http://%s%s%s" % (req.env["SERVER_NAME"], port, uri)
+ port = req.env["SERVER_PORT"]
+ port = port != "80" and (":" + port) or ""
+ urlbase = 'http://%s%s' % (req.env['SERVER_NAME'], port)
if not self.reponame:
self.reponame = (self.repo.ui.config("web", "name")
@@ -759,6 +755,7 @@ class hgweb(object):
self.t = templater.templater(mapfile, templater.common_filters,
defaults={"url": req.url,
+ "urlbase": urlbase,
"repo": self.reponame,
"header": header,
"footer": footer,
--- a/templates/rss/changelogentry.tmpl
+++ b/templates/rss/changelogentry.tmpl
@@ -1,6 +1,6 @@
<item>
<title>#desc|strip|firstline|strip|escape#</title>
- <link>#url#?cs=#node|short#</link>
+ <link>{urlbase}{url}rev/{node|short}</link>
<description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
<author>#author|obfuscate#</author>
<pubDate>#date|rfc822date#</pubDate>
--- a/templates/rss/filelogentry.tmpl
+++ b/templates/rss/filelogentry.tmpl
@@ -1,6 +1,6 @@
<item>
<title>#desc|strip|firstline|strip|escape#</title>
- <link>#url#?f=#node|short#;file=#file|urlescape#</link>
+ <link>{urlbase}{url}log{#node|short#}/{file|urlescape}</link>
<description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
<author>#author|obfuscate#</author>
<pubDate>#date|rfc822date#</pubDate>
--- a/templates/rss/header.tmpl
+++ b/templates/rss/header.tmpl
@@ -2,5 +2,5 @@ Content-type: text/xml
<rss version="2.0">
<channel>
- <link>#url#</link>
+ <link>{urlbase}{url}</link>
<language>en-us</language>
--- a/templates/rss/tagentry.tmpl
+++ b/templates/rss/tagentry.tmpl
@@ -1,6 +1,6 @@
<item>
<title>#tag|escape#</title>
- <link>#url#?cs=#node|short#</link>
+ <link>{urlbase}{url}rev/{node|short}</link>
<description><![CDATA[#tag|strip|escape|addbreaks#]]></description>
<pubDate>#date|rfc822date#</pubDate>
</item>