##// END OF EJS Templates
Fix RSS URLs (closes issue396)
Brendan Cully -
r3423:a2179e78 default
parent child Browse files
Show More
@@ -744,13 +744,9 b' class hgweb(object):'
744 style = req.form['style'][0]
744 style = req.form['style'][0]
745 mapfile = style_map(self.templatepath, style)
745 mapfile = style_map(self.templatepath, style)
746
746
747 if not req.url:
747 port = req.env["SERVER_PORT"]
748 port = req.env["SERVER_PORT"]
748 port = port != "80" and (":" + port) or ""
749 port = port != "80" and (":" + port) or ""
749 urlbase = 'http://%s%s' % (req.env['SERVER_NAME'], port)
750 uri = req.env["REQUEST_URI"]
751 if "?" in uri:
752 uri = uri.split("?")[0]
753 req.url = "http://%s%s%s" % (req.env["SERVER_NAME"], port, uri)
754
750
755 if not self.reponame:
751 if not self.reponame:
756 self.reponame = (self.repo.ui.config("web", "name")
752 self.reponame = (self.repo.ui.config("web", "name")
@@ -759,6 +755,7 b' class hgweb(object):'
759
755
760 self.t = templater.templater(mapfile, templater.common_filters,
756 self.t = templater.templater(mapfile, templater.common_filters,
761 defaults={"url": req.url,
757 defaults={"url": req.url,
758 "urlbase": urlbase,
762 "repo": self.reponame,
759 "repo": self.reponame,
763 "header": header,
760 "header": header,
764 "footer": footer,
761 "footer": footer,
@@ -1,6 +1,6 b''
1 <item>
1 <item>
2 <title>#desc|strip|firstline|strip|escape#</title>
2 <title>#desc|strip|firstline|strip|escape#</title>
3 <link>#url#?cs=#node|short#</link>
3 <link>{urlbase}{url}rev/{node|short}</link>
4 <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
4 <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
5 <author>#author|obfuscate#</author>
5 <author>#author|obfuscate#</author>
6 <pubDate>#date|rfc822date#</pubDate>
6 <pubDate>#date|rfc822date#</pubDate>
@@ -1,6 +1,6 b''
1 <item>
1 <item>
2 <title>#desc|strip|firstline|strip|escape#</title>
2 <title>#desc|strip|firstline|strip|escape#</title>
3 <link>#url#?f=#node|short#;file=#file|urlescape#</link>
3 <link>{urlbase}{url}log{#node|short#}/{file|urlescape}</link>
4 <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
4 <description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
5 <author>#author|obfuscate#</author>
5 <author>#author|obfuscate#</author>
6 <pubDate>#date|rfc822date#</pubDate>
6 <pubDate>#date|rfc822date#</pubDate>
@@ -2,5 +2,5 b' Content-type: text/xml'
2
2
3 <rss version="2.0">
3 <rss version="2.0">
4 <channel>
4 <channel>
5 <link>#url#</link>
5 <link>{urlbase}{url}</link>
6 <language>en-us</language>
6 <language>en-us</language>
@@ -1,6 +1,6 b''
1 <item>
1 <item>
2 <title>#tag|escape#</title>
2 <title>#tag|escape#</title>
3 <link>#url#?cs=#node|short#</link>
3 <link>{urlbase}{url}rev/{node|short}</link>
4 <description><![CDATA[#tag|strip|escape|addbreaks#]]></description>
4 <description><![CDATA[#tag|strip|escape|addbreaks#]]></description>
5 <pubDate>#date|rfc822date#</pubDate>
5 <pubDate>#date|rfc822date#</pubDate>
6 </item>
6 </item>
General Comments 0
You need to be logged in to leave comments. Login now