diff --git a/mercurial/hgweb.py b/mercurial/hgweb.py --- a/mercurial/hgweb.py +++ b/mercurial/hgweb.py @@ -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 @@ class templater(object): 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), diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -108,6 +108,8 @@ class manifest(revlog): 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] diff --git a/templates/changelog-gitweb.tmpl b/templates/changelog-gitweb.tmpl --- a/templates/changelog-gitweb.tmpl +++ b/templates/changelog-gitweb.tmpl @@ -11,7 +11,7 @@