# HG changeset patch # User Brendan Cully # Date 1161022686 25200 # Node ID a2179e78d18b52f14feaaaad66bdc0ec265d704e # Parent 0eba7e76cd0284405f066a637bdd18adbd846049 Fix RSS URLs (closes issue396) diff -r 0eba7e76cd02 -r a2179e78d18b mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Mon Oct 16 11:02:11 2006 -0700 +++ b/mercurial/hgweb/hgweb_mod.py Mon Oct 16 11:18:06 2006 -0700 @@ -744,13 +744,9 @@ 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 @@ self.t = templater.templater(mapfile, templater.common_filters, defaults={"url": req.url, + "urlbase": urlbase, "repo": self.reponame, "header": header, "footer": footer, diff -r 0eba7e76cd02 -r a2179e78d18b templates/rss/changelogentry.tmpl --- a/templates/rss/changelogentry.tmpl Mon Oct 16 11:02:11 2006 -0700 +++ b/templates/rss/changelogentry.tmpl Mon Oct 16 11:18:06 2006 -0700 @@ -1,6 +1,6 @@ #desc|strip|firstline|strip|escape# - #url#?cs=#node|short# + {urlbase}{url}rev/{node|short} #author|obfuscate# #date|rfc822date# diff -r 0eba7e76cd02 -r a2179e78d18b templates/rss/filelogentry.tmpl --- a/templates/rss/filelogentry.tmpl Mon Oct 16 11:02:11 2006 -0700 +++ b/templates/rss/filelogentry.tmpl Mon Oct 16 11:18:06 2006 -0700 @@ -1,6 +1,6 @@ #desc|strip|firstline|strip|escape# - #url#?f=#node|short#;file=#file|urlescape# + {urlbase}{url}log{#node|short#}/{file|urlescape} #author|obfuscate# #date|rfc822date# diff -r 0eba7e76cd02 -r a2179e78d18b templates/rss/header.tmpl --- a/templates/rss/header.tmpl Mon Oct 16 11:02:11 2006 -0700 +++ b/templates/rss/header.tmpl Mon Oct 16 11:18:06 2006 -0700 @@ -2,5 +2,5 @@ - #url# + {urlbase}{url} en-us diff -r 0eba7e76cd02 -r a2179e78d18b templates/rss/tagentry.tmpl --- a/templates/rss/tagentry.tmpl Mon Oct 16 11:02:11 2006 -0700 +++ b/templates/rss/tagentry.tmpl Mon Oct 16 11:18:06 2006 -0700 @@ -1,6 +1,6 @@ #tag|escape# - #url#?cs=#node|short# + {urlbase}{url}rev/{node|short} #date|rfc822date#