changed template escape filter, added urlescape filter; audited all templates for insertion bugs; added note to manifest.py about newlines in filenames
--- a/mercurial/hgweb.py Sun Jan 29 11:17:54 2006 +1300
+++ b/mercurial/hgweb.py Sun Jan 29 00:18:52 2006 +0100
@@ -6,7 +6,7 @@
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
-import os, cgi, sys
+import os, cgi, sys, urllib
from demandload import demandload
demandload(globals(), "mdiff time re socket zlib errno ui hg ConfigParser")
demandload(globals(), "zipfile tempfile StringIO tarfile BaseHTTPServer util")
@@ -163,7 +163,8 @@
return
common_filters = {
- "escape": cgi.escape,
+ "escape": lambda x: cgi.escape(x, True),
+ "urlescape": urllib.quote,
"strip": lambda x: x.strip(),
"age": age,
"date": lambda x: util.datestr(x),
--- a/mercurial/manifest.py Sun Jan 29 11:17:54 2006 +1300
+++ b/mercurial/manifest.py Sun Jan 29 00:18:52 2006 +0100
@@ -108,6 +108,8 @@
files = map.keys()
files.sort()
+ % if this is changed to support newlines in filenames,
+ % be sure to check the templates/ dir again (especially *-raw.tmpl)
text = ["%s\000%s%s\n" %
(f, hex(map[f]), flags[f] and "x" or '')
for f in files]
--- a/templates/changelog-gitweb.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/changelog-gitweb.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -11,7 +11,7 @@
<form action="#">
<div class="search">
-<input type="hidden" name="repo" value="#repo#" />
+<input type="hidden" name="repo" value="#repo|escape#" />
<input type="hidden" name="style" value="gitweb" />
<input type="hidden" name="cmd" value="changelog" />
<input type="text" name="rev" />
--- a/templates/changelogentry-gitweb.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/changelogentry-gitweb.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -8,7 +8,7 @@
<i>#author|obfuscate# [#date|rfc822date#]</i><br/>
</div>
<div class="log_body">
-#desc|addbreaks#
+#desc|escape|addbreaks#
<br/>
<br/>
</div>
--- a/templates/changeset-gitweb.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/changeset-gitweb.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -28,7 +28,7 @@
</table></div>
<div class="title_text">
-#desc|addbreaks#
+#desc|escape|addbreaks#
</div>
<div class="title_text">
--- a/templates/fileannotate-gitweb.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/fileannotate-gitweb.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -10,10 +10,10 @@
</div>
<div class="page_nav">
-<a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=#path#;style=gitweb">manifest</a> | <a href="?cmd=changeset;node=#node#;style=gitweb">changeset</a> | <a href="?cmd=file;file=#file#;filenode=#filenode#;style=gitweb">file</a> | <a href="?cmd=filelog;file=#file#;filenode=#filenode#;style=gitweb">revisions</a> | annotate<br/>
+<a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=manifest;manifest=#manifest#;path=#path|urlescape#;style=gitweb">manifest</a> | <a href="?cmd=changeset;node=#node#;style=gitweb">changeset</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=gitweb">file</a> | <a href="?cmd=filelog;file=#file|urlescape#;filenode=#filenode#;style=gitweb">revisions</a> | annotate<br/>
</div>
-<div class="title">#file#</div>
+<div class="title">#file|escape#</div>
<table>
<tr>
--- a/templates/fileannotate.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/fileannotate.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -1,5 +1,5 @@
#header#
-<title>#repo|escape#: #file# annotate</title>
+<title>#repo|escape#: #file|escape# annotate</title>
</head>
<body>
@@ -7,12 +7,12 @@
<a href="?cl=#rev#">changelog</a>
<a href="?tags=">tags</a>
<a href="?cs=#node|short#">changeset</a>
-<a href="?mf=#manifest|short#;path=#path#">manifest</a>
-<a href="?f=#filenode|short#;file=#file#">file</a>
-<a href="?fl=#filenode|short#;file=#file#">revisions</a>
+<a href="?mf=#manifest|short#;path=#path|urlescape#">manifest</a>
+<a href="?f=#filenode|short#;file=#file|urlescape#">file</a>
+<a href="?fl=#filenode|short#;file=#file|urlescape#">revisions</a>
</div>
-<h2>Annotate #file#</h2>
+<h2>Annotate #file|escape#</h2>
<table>
<tr>
--- a/templates/filediff.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/filediff.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -1,5 +1,5 @@
#header#
-<title>#repo|escape#: #file# diff</title>
+<title>#repo|escape#: #file|escape# diff</title>
</head>
<body>
@@ -7,13 +7,13 @@
<a href="?cl=#rev#">changelog</a>
<a href="?tags=">tags</a>
<a href="?cs=#node|short#">changeset</a>
-<a href="?f=#filenode|short#;file=#file#">file</a>
-<a href="?fl=#filenode|short#;file=#file#">revisions</a>
-<a href="?fa=#filenode|short#;file=#file#">annotate</a>
-<a href="?fd=#node|short#;file=#file#;style=raw">raw</a>
+<a href="?f=#filenode|short#;file=#file|urlescape#">file</a>
+<a href="?fl=#filenode|short#;file=#file|urlescape#">revisions</a>
+<a href="?fa=#filenode|short#;file=#file|urlescape#">annotate</a>
+<a href="?fd=#node|short#;file=#file|urlescape#;style=raw">raw</a>
</div>
-<h2>#file#</h2>
+<h2>#file|escape#</h2>
<table id="filediffEntry">
<tr>
--- a/templates/filelog-gitweb.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/filelog-gitweb.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -10,7 +10,7 @@
</div>
<div class="page_nav">
-<a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=file;file=#file#;filenode=#filenode#;style=gitweb">file</a> | revisions | <a href="?cmd=annotate;file=#file#;filenode=#filenode#;style=gitweb">annotate</a> | <a href="?fl=#filenode|short#;file=#file#;style=rss">rss</a><br/>
+<a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=gitweb">file</a> | revisions | <a href="?cmd=annotate;file=#file|urlescape#;filenode=#filenode#;style=gitweb">annotate</a> | <a href="?fl=#filenode|short#;file=#file|urlescape#;style=rss">rss</a><br/>
</div>
<table>
--- a/templates/filelog-rss.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/filelog-rss.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -1,6 +1,6 @@
#header#
- <title>#repo|escape#: #file# history</title>
- <description>#file# revision history</description>
+ <title>#repo|escape#: #file|escape# history</title>
+ <description>#file|escape# revision history</description>
#entries%filelogentry#
</channel>
-</rss>
\ No newline at end of file
+</rss>
--- a/templates/filelog.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/filelog.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -1,7 +1,7 @@
#header#
-<title>#repo|escape#: #file# history</title>
+<title>#repo|escape#: #file|escape# history</title>
<link rel="alternate" type="application/rss+xml"
- href="?fl=0;file=#file#;style=rss" title="RSS feed for #repo|escape#:#file#">
+ href="?fl=0;file=#file|urlescape#;style=rss" title="RSS feed for #repo|escape#:#file#">
</head>
</head>
<body>
@@ -9,12 +9,12 @@
<div class="buttons">
<a href="?cl=tip">changelog</a>
<a href="?tags=">tags</a>
-<a href="?f=#filenode|short#;file=#file#">file</a>
-<a href="?fa=#filenode|short#;file=#file#">annotate</a>
-<a type="application/rss+xml" href="?fl=0;file=#file#;style=rss">rss</a>
+<a href="?f=#filenode|short#;file=#file|urlescape#">file</a>
+<a href="?fa=#filenode|short#;file=#file|urlescape#">annotate</a>
+<a type="application/rss+xml" href="?fl=0;file=#file|urlescape#;style=rss">rss</a>
</div>
-<h2>#file# revision history</h2>
+<h2>#file|escape# revision history</h2>
#entries%filelogentry#
--- a/templates/filelogentry-rss.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/filelogentry-rss.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -1,6 +1,6 @@
<item>
<title>#desc|strip|firstline|strip|escape#</title>
- <link>#url#?f=#filenode|short#;file=#file#</link>
+ <link>#url#?f=#filenode|short#;file=#file|urlescape#</link>
<description><![CDATA[#desc|strip|escape|addbreaks#]]></description>
<author>#author|obfuscate#</author>
<pubDate>#date|rfc822date#</pubDate>>
--- a/templates/filelogentry.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/filelogentry.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -4,9 +4,9 @@
<td><b><a href="?cs=#node|short#">#desc|strip|firstline|escape#</a></b></td></tr>
<tr>
<td align="right">revision #filerev#: </td>
- <td><a href="?f=#filenode|short#;file=#file#">#filenode|short#</a>
-<a href="?fd=#node|short#;file=#file#">(diff)</a>
-<a href="?fa=#filenode|short#;file=#file#">(annotate)</a>
+ <td><a href="?f=#filenode|short#;file=#file|urlescape#">#filenode|short#</a>
+<a href="?fd=#node|short#;file=#file|urlescape#">(diff)</a>
+<a href="?fa=#filenode|short#;file=#file|urlescape#">(annotate)</a>
</td></tr>
<tr>
<td align="right">author: </td>
--- a/templates/filerevision-gitweb.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/filerevision-gitweb.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -10,10 +10,10 @@
</div>
<div class="page_nav">
-<a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?mf=#manifest|short#;path=#path#;style=gitweb">manifest</a> | <a href="?cmd=changeset;node=#node#;style=gitweb">changeset</a> | file | <a href="?cmd=filelog;file=#file#;filenode=#filenode#;style=gitweb">revisions</a> | <a href="?cmd=annotate;file=#file#;filenode=#filenode#;style=gitweb">annotate</a> | <a href="?cmd=file;file=#file#;filenode=#filenode#;style=raw">raw</a><br/>
+<a href="?cmd=summary;style=gitweb">summary</a> | <a href="?cmd=changelog;style=gitweb">changelog</a> | <a href="?cmd=tags;style=gitweb">tags</a> | <a href="?mf=#manifest|short#;path=#path|urlescape#;style=gitweb">manifest</a> | <a href="?cmd=changeset;node=#node#;style=gitweb">changeset</a> | file | <a href="?cmd=filelog;file=#file|urlescape#;filenode=#filenode#;style=gitweb">revisions</a> | <a href="?cmd=annotate;file=#file|urlescape#;filenode=#filenode#;style=gitweb">annotate</a> | <a href="?cmd=file;file=#file|urlescape#;filenode=#filenode#;style=raw">raw</a><br/>
</div>
-<div class="title">#file#</div>
+<div class="title">#file|escape#</div>
<table>
<tr>
--- a/templates/filerevision.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/filerevision.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -1,5 +1,5 @@
#header#
-<title>#repo|escape#:#file#</title>
+<title>#repo|escape#:#file|escape#</title>
</head>
<body>
@@ -7,13 +7,13 @@
<a href="?cl=#rev#">changelog</a>
<a href="?tags=">tags</a>
<a href="?cs=#node|short#">changeset</a>
-<a href="?mf=#manifest|short#;path=#path#">manifest</a>
-<a href="?fl=#filenode|short#;file=#file#">revisions</a>
-<a href="?fa=#filenode|short#;file=#file#">annotate</a>
-<a href="?f=#filenode|short#;file=#file#;style=raw">raw</a>
+<a href="?mf=#manifest|short#;path=#path|urlescape#">manifest</a>
+<a href="?fl=#filenode|short#;file=#file|urlescape#">revisions</a>
+<a href="?fa=#filenode|short#;file=#file|urlescape#">annotate</a>
+<a href="?f=#filenode|short#;file=#file|urlescape#;style=raw">raw</a>
</div>
-<h2>#file#</h2>
+<h2>#file|escape#</h2>
<table>
<tr>
--- a/templates/manifest-gitweb.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/manifest-gitweb.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -18,7 +18,7 @@
<table cellspacing="0">
<tr class="light">
<td style="font-family:monospace">drwxr-xr-x</td>
-<td><a href="?cmd=manifest;manifest=#manifest#;path=#up#;style=gitweb">[up]</a></td>
+<td><a href="?cmd=manifest;manifest=#manifest#;path=#up|urlescape#;style=gitweb">[up]</a></td>
<td class="link"> </td>
</tr>
#dentries%manifestdirentry#
--- a/templates/manifest.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/manifest.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -10,12 +10,12 @@
#archives%archiveentry#
</div>
-<h2>manifest for changeset #node|short#: #path#</h2>
+<h2>manifest for changeset #node|short#: #path|escape#</h2>
<table cellpadding="0" cellspacing="0">
<tr class="parity1">
<td><tt>drwxr-xr-x</tt>
- <td><a href="?mf=#manifest|short#;path=#up#">[up]</a>
+ <td><a href="?mf=#manifest|short#;path=#up|urlescape#">[up]</a>
#dentries%manifestdirentry#
#fentries%manifestfileentry#
</table>
--- a/templates/map Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/map Sun Jan 29 00:18:52 2006 +0100
@@ -3,16 +3,16 @@
footer = footer.tmpl
search = search.tmpl
changelog = changelog.tmpl
-naventry = "<a href="?cl=#rev#">#label#</a> "
-filedifflink = "<a href="?fd=#node|short#;file=#file#">#file#</a> "
-filenodelink = "<a href="?f=#filenode|short#;file=#file#">#file#</a> "
+naventry = "<a href="?cl=#rev#">#label|escape#</a> "
+filedifflink = "<a href="?fd=#node|short#;file=#file|urlescape#">#file|escape#</a> "
+filenodelink = "<a href="?f=#filenode|short#;file=#file|urlescape#">#file|escape#</a> "
fileellipses = "..."
changelogentry = changelogentry.tmpl
searchentry = changelogentry.tmpl
changeset = changeset.tmpl
manifest = manifest.tmpl
-manifestdirentry = "<tr class="parity#parity#"><td><tt>drwxr-xr-x</tt> <td><a href="?cmd=manifest;manifest=#manifest#;path=#path#">#basename#/</a>"
-manifestfileentry = "<tr class="parity#parity#"><td><tt>#permissions|permissions#</tt> <td><a href="?f=#filenode|short#;file=#file#">#basename#</a>"
+manifestdirentry = "<tr class="parity#parity#"><td><tt>drwxr-xr-x</tt> <td><a href="?cmd=manifest;manifest=#manifest#;path=#path|urlescape#">#basename|escape#/</a>"
+manifestfileentry = "<tr class="parity#parity#"><td><tt>#permissions|permissions#</tt> <td><a href="?f=#filenode|short#;file=#file|urlescape#">#basename|escape#</a>"
filerevision = filerevision.tmpl
fileannotate = fileannotate.tmpl
filediff = filediff.tmpl
@@ -26,23 +26,23 @@
diffline = "#line|escape#"
changelogparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
changesetparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
-filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
-fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?fa=#filenode|short#;file=#file#">#node|short#</a></td></tr>"
+filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?f=#node|short#;file=#file|urlescape#">#node|short#</a></td></tr>"
+fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?fa=#filenode|short#;file=#file|urlescape#">#node|short#</a></td></tr>"
changesetchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
changelogchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
-filerevchild = "<tr><td class="metatag">child:</td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
-fileannotatechild = "<tr><td class="metatag">child:</td><td><a href="?fa=#filenode|short#;file=#file#">#node|short#</a></td></tr>"
+filerevchild = "<tr><td class="metatag">child:</td><td><a href="?f=#node|short#;file=#file|urlescape#">#node|short#</a></td></tr>"
+fileannotatechild = "<tr><td class="metatag">child:</td><td><a href="?fa=#filenode|short#;file=#file|urlescape#">#node|short#</a></td></tr>"
tags = tags.tmpl
-tagentry = "<li class="tagEntry parity#parity#"><span class="node">#node#</span> <a href="?cs=#node|short#">#tag#</a></li>"
+tagentry = "<li class="tagEntry parity#parity#"><span class="node">#node#</span> <a href="?cs=#node|short#">#tag|escape#</a></li>"
diffblock = "<pre class="parity#parity#">#lines#</pre>"
-changelogtag = "<tr><th class="tag">tag:</th><td class="tag">#tag#</td></tr>"
-changesettag = "<tr><th class="tag">tag:</th><td class="tag">#tag#</td></tr>"
+changelogtag = "<tr><th class="tag">tag:</th><td class="tag">#tag|escape#</td></tr>"
+changesettag = "<tr><th class="tag">tag:</th><td class="tag">#tag|escape#</td></tr>"
filediffparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
-filelogparent = "<tr><td align="right">parent #rev#: </td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
+filelogparent = "<tr><td align="right">parent #rev#: </td><td><a href="?f=#node|short#;file=#file|urlescape#">#node|short#</a></td></tr>"
filediffchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cs=#node|short#">#node|short#</a></td></tr>"
-filelogchild = "<tr><td align="right">child #rev#: </td><td><a href="?f=#node|short#;file=#file#">#node|short#</a></td></tr>"
-indexentry = "<tr class="parity#parity#"><td><a href="#url#">#name#</a></td><td>#shortdesc#</td><td>#contact|obfuscate#</td><td>#lastupdate|age# ago</td><td><a href="#url#?cl=tip;style=rss">RSS</a></td></tr>"
+filelogchild = "<tr><td align="right">child #rev#: </td><td><a href="?f=#node|short#;file=#file|urlescape#">#node|short#</a></td></tr>"
+indexentry = "<tr class="parity#parity#"><td><a href="#url#">#name|escape#</a></td><td>#shortdesc|escape#</td><td>#contact|obfuscate#</td><td>#lastupdate|age# ago</td><td><a href="#url#?cl=tip;style=rss">RSS</a></td></tr>"
index = index.tmpl
-archiveentry = "<a href="?ca=#node|short#;type=#type#">#type#</a> "
+archiveentry = "<a href="?ca=#node|short#;type=#type|urlescape#">#type|escape#</a> "
notfound = notfound.tmpl
error = error.tmpl
--- a/templates/map-gitweb Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/map-gitweb Sun Jan 29 00:18:52 2006 +0100
@@ -5,17 +5,17 @@
changelog = changelog-gitweb.tmpl
summary = summary-gitweb.tmpl
error = error-gitweb.tmpl
-naventry = "<a href="?cmd=changelog;rev=#rev#;style=gitweb">#label#</a> "
-navshortentry = "<a href="?cmd=shortlog;rev=#rev#;style=gitweb">#label#</a> "
-filedifflink = "<a href="?cmd=filediff;node=#node#;file=#file#;style=gitweb">#file#</a> "
-filenodelink = "<tr class="light"><td><a class="list" href="">#file#</a></td><td></td><td class="link"><a href="?cmd=file;filenode=#filenode#;file=#file#;style=gitweb">file</a> | <!-- FIXME: <a href="?fd=#filenode|short#;file=#file#;style=gitweb">diff</a> | --> <a href="?cmd=filelog;filenode=#filenode|short#;file=#file#;style=gitweb">revisions</a></td></tr>"
+naventry = "<a href="?cmd=changelog;rev=#rev#;style=gitweb">#label|escape#</a> "
+navshortentry = "<a href="?cmd=shortlog;rev=#rev#;style=gitweb">#label|escape#</a> "
+filedifflink = "<a href="?cmd=filediff;node=#node#;file=#file|urlescape#;style=gitweb">#file|escape#</a> "
+filenodelink = "<tr class="light"><td><a class="list" href="">#file|escape#</a></td><td></td><td class="link"><a href="?cmd=file;filenode=#filenode#;file=#file|urlescape#;style=gitweb">file</a> | <!-- FIXME: <a href="?fd=#filenode|short#;file=#file|urlescape#;style=gitweb">diff</a> | --> <a href="?cmd=filelog;filenode=#filenode|short#;file=#file|urlescape#;style=gitweb">revisions</a></td></tr>"
fileellipses = "..."
changelogentry = changelogentry-gitweb.tmpl
searchentry = changelogentry-gitweb.tmpl
changeset = changeset-gitweb.tmpl
manifest = manifest-gitweb.tmpl
-manifestdirentry = "<tr class="parity#parity#"><td style="font-family:monospace">drwxr-xr-x</td><td><a href="?mf=#manifest|short#;path=#path#;style=gitweb">#basename#/</a></td><td class="link"><a href="?mf=#manifest|short#;path=#path#;style=gitweb">manifest</a></td></tr>"
-manifestfileentry = "<tr class="parity#parity#"><td style="font-family:monospace">#permissions|permissions#</td><td class="list"><a class="list" href="?f=#filenode|short#;file=#file#;style=gitweb">#basename#</a></td><td class="link"><a href="?f=#filenode|short#;file=#file#;style=gitweb">file</a> | <a href="?fl=#filenode|short#;file=#file#;style=gitweb">revisions</a> | <a href="?fa=#filenode|short#;file=#file#;style=gitweb">annotate</a></td></tr>"
+manifestdirentry = "<tr class="parity#parity#"><td style="font-family:monospace">drwxr-xr-x</td><td><a href="?mf=#manifest|short#;path=#path|urlescape#;style=gitweb">#basename|escape#/</a></td><td class="link"><a href="?mf=#manifest|short#;path=#path|urlescape#;style=gitweb">manifest</a></td></tr>"
+manifestfileentry = "<tr class="parity#parity#"><td style="font-family:monospace">#permissions|permissions#</td><td class="list"><a class="list" href="?f=#filenode|short#;file=#file|urlescape#;style=gitweb">#basename|escape#</a></td><td class="link"><a href="?f=#filenode|short#;file=#file|urlescape#;style=gitweb">file</a> | <a href="?fl=#filenode|short#;file=#file|urlescape#;style=gitweb">revisions</a> | <a href="?fa=#filenode|short#;file=#file|urlescape#;style=gitweb">annotate</a></td></tr>"
filerevision = filerevision-gitweb.tmpl
fileannotate = fileannotate-gitweb.tmpl
filelog = filelog-gitweb.tmpl
@@ -28,22 +28,22 @@
diffline = "<div class="pre">#line|escape#</div>"
changelogparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cmd=changeset;node=#node#;style=gitweb">#node|short#</a></td></tr>"
changesetparent = "<tr><td>parent</td><td style="font-family:monospace"><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb">#node|short#</a></td></tr>"
-filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
-fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
+filerevparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=file;file=#file|urlescape#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
+fileannotateparent = "<tr><td class="metatag">parent:</td><td><a href="?cmd=annotate;file=#file|urlescape#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
changelogchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cmd=changeset;node=#node#;style=gitweb">#node|short#</a></td></tr>"
changesetchild = "<tr><td>child</td><td style="font-family:monospace"><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb">#node|short#</a></td></tr>"
-filerevchild = "<tr><td class="metatag">child:</td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
-fileannotatechild = "<tr><td class="metatag">child:</td><td><a href="?cmd=annotate;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
+filerevchild = "<tr><td class="metatag">child:</td><td><a href="?cmd=file;file=#file|urlescape#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
+fileannotatechild = "<tr><td class="metatag">child:</td><td><a href="?cmd=annotate;file=#file|urlescape#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
tags = tags-gitweb.tmpl
-tagentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#tag#</b></a></td><td class="link"><a href="?cmd=changeset;node=#node|short#;style=gitweb">changeset</a> | <a href="?cmd=changelog;rev=#node|short#;style=gitweb">changelog</a> | <a href="?mf=#tagmanifest|short#;path=/;style=gitweb">manifest</a></td></tr>"
+tagentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#tag|escape#</b></a></td><td class="link"><a href="?cmd=changeset;node=#node|short#;style=gitweb">changeset</a> | <a href="?cmd=changelog;rev=#node|short#;style=gitweb">changelog</a> | <a href="?mf=#tagmanifest|short#;path=/;style=gitweb">manifest</a></td></tr>"
diffblock = "#lines#"
-changelogtag = "<tr><th class="tag">tag:</th><td class="tag">#tag#</td></tr>"
-changesettag = "<tr><td>tag</td><td>#tag#</td></tr>"
+changelogtag = "<tr><th class="tag">tag:</th><td class="tag">#tag|escape#</td></tr>"
+changesettag = "<tr><td>tag</td><td>#tag|escape#</td></tr>"
filediffparent = "<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="?cmd=changeset;node=#node#;style=gitweb">#node|short#</a></td></tr>"
-filelogparent = "<tr><td align="right">parent #rev#: </td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
+filelogparent = "<tr><td align="right">parent #rev#: </td><td><a href="?cmd=file;file=#file|urlescape#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
filediffchild = "<tr><th class="child">child #rev#:</th><td class="child"><a href="?cmd=changeset;node=#node#;style=gitweb">#node|short#</a></td></tr>"
-filelogchild = "<tr><td align="right">child #rev#: </td><td><a href="?cmd=file;file=#file#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
+filelogchild = "<tr><td align="right">child #rev#: </td><td><a href="?cmd=file;file=#file|urlescape#;filenode=#node#;style=gitweb">#node|short#</a></td></tr>"
shortlog = shortlog-gitweb.tmpl
shortlogentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#desc|firstline|escape#</b></a></td><td class="link"><a href="?cmd=changeset;node=#node|short#;style=gitweb">changeset</a> | <a href="?cmd=manifest;manifest=#manifest|short#;path=/;style=gitweb">manifest</a></td></tr>"
-filelogentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#desc|firstline|escape#</b></a></td><td class="link"><!-- FIXME: <a href="?fd=#node|short#;file=#file#;style=gitweb">diff</a> | --> <a href="?fa=#filenode|short#;file=#file#;style=gitweb">annotate</a></td></tr>"
-archiveentry = " | <a href="?ca=#node|short#;type=#type#">#type#</a> "
+filelogentry = "<tr class="parity#parity#"><td><i>#date|age# ago</i></td><td><a class="list" href="?cmd=changeset;node=#node|short#;style=gitweb"><b>#desc|firstline|escape#</b></a></td><td class="link"><!-- FIXME: <a href="?fd=#node|short#;file=#file|urlescape#;style=gitweb">diff</a> | --> <a href="?fa=#filenode|short#;file=#file|urlescape#;style=gitweb">annotate</a></td></tr>"
+archiveentry = " | <a href="?ca=#node|short#;type=#type|urlescape#">#type|escape#</a> "
--- a/templates/map-raw Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/map-raw Sun Jan 29 00:18:52 2006 +0100
@@ -1,15 +1,15 @@
header = header-raw.tmpl
footer = ""
changeset = changeset-raw.tmpl
-annotateline = "<tr class="parity#parity#"><td class="annotate"><a href="?cmd=changeset;node=#node#">#author#@#rev#</a></td><td><pre>#line#</pre></td></tr>"
-difflineplus = "#line#"
-difflineminus = "#line#"
-difflineat = "#line#"
-diffline = "#line#"
+annotateline = "<tr class="parity#parity#"><td class="annotate"><a href="?cmd=changeset;node=#node#">#author#@#rev#</a></td><td><pre>#line|escape#</pre></td></tr>"
+difflineplus = "#line|escape#"
+difflineminus = "#line|escape#"
+difflineat = "#line|escape#"
+diffline = "#line|escape#"
changesetparent = "# parent: #node#"
changesetchild = "# child: #node#"
-filenodelink = "#file#"
+filenodelink = "#file|urlescape#"
filerevision = filerevision-raw.tmpl
-fileline = "#line#"
+fileline = "#line|escape#"
diffblock = "#lines#"
filediff = filediff-raw.tmpl
--- a/templates/summary-gitweb.tmpl Sun Jan 29 11:17:54 2006 +1300
+++ b/templates/summary-gitweb.tmpl Sun Jan 29 00:18:52 2006 +0100
@@ -14,14 +14,14 @@
<div class="title"> </div>
<table cellspacing="0">
-<tr><td>description</td><td>#desc#</td></tr>
-<tr><td>owner</td><td>#owner#</td></tr>
+<tr><td>description</td><td>#desc|escape#</td></tr>
+<tr><td>owner</td><td>#owner|escape#</td></tr>
<!-- <tr><td>last change</td><td>#lastchange|rfc822date#</td></tr> -->
</table>
<div><a class="title" href="?cmd=changelog;style=gitweb">changes</a></div>
<table cellspacing="0">
-#shortlog#
+#shortlog|escape#
<tr class="light"><td colspan="3"><a class="list" href="?cmd=changelog;style=gitweb">...</a></td></tr>
</table>