merge with stable
authorMatt Mackall <mpm@selenic.com>
Fri, 01 Feb 2013 15:48:33 -0600
changeset 18535 7068089c95a2
parent 18452 8bd338c7c4c9 (current diff)
parent 18534 151f78a07607 (diff)
child 18536 ae645d4f084c
merge with stable
--- a/.hgsigs	Sat Jan 19 17:20:39 2013 -0600
+++ b/.hgsigs	Fri Feb 01 15:48:33 2013 -0600
@@ -63,3 +63,5 @@
 195ad823b5d58c68903a6153a25e3fb4ed25239d 0 iD8DBQBQkuT9ywK+sNU5EO8RAhB4AKCeerItoK2Jipm2cVf4euGofAa/WACeJj3TVd4pFILpb+ogj7ebweFLJi0=
 0c10cf8191469e7c3c8844922e17e71a176cb7cb 0 iD8DBQBQvQWoywK+sNU5EO8RAnq3AJoCn98u4geFx5YaQaeh99gFhCd7bQCgjoBwBSUyOvGd0yBy60E3Vv3VZhM=
 a4765077b65e6ae29ba42bab7834717b5072d5ba 0 iD8DBQBQ486sywK+sNU5EO8RAhmJAJ90aLfLKZhmcZN7kqphigQJxiFOQACeJ5IUZxjGKH4xzi3MrgIcx9n+dB0=
+f5fbe15ca7449f2c9a3cf817c86d0ae68b307214 0 iD8DBQBQ+yuYywK+sNU5EO8RAm9JAJoD/UciWvpGeKBcpGtZJBFJVcL/HACghDXSgQ+xQDjB+6uGrdgAQsRR1Lg=
+a6088c05e43a8aee0472ca3a4f6f8d7dd914ebbf 0 iD8DBQBRDDROywK+sNU5EO8RAh75AJ9uJCGoCWnP0Lv/+XuYs4hvUl+sAgCcD36QgAnuw8IQXrvv684BAXAnHcA=
--- a/.hgtags	Sat Jan 19 17:20:39 2013 -0600
+++ b/.hgtags	Fri Feb 01 15:48:33 2013 -0600
@@ -76,3 +76,5 @@
 195ad823b5d58c68903a6153a25e3fb4ed25239d 2.4
 0c10cf8191469e7c3c8844922e17e71a176cb7cb 2.4.1
 a4765077b65e6ae29ba42bab7834717b5072d5ba 2.4.2
+f5fbe15ca7449f2c9a3cf817c86d0ae68b307214 2.5-rc
+a6088c05e43a8aee0472ca3a4f6f8d7dd914ebbf 2.5
--- a/contrib/check-code.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/contrib/check-code.py	Fri Feb 01 15:48:33 2013 -0600
@@ -78,7 +78,7 @@
   [
     (r'^function', "don't use 'function', use old style"),
     (r'^diff.*-\w*N', "don't use 'diff -N'"),
-    (r'\$PWD', "don't use $PWD, use `pwd`"),
+    (r'\$PWD|\${PWD}', "don't use $PWD, use `pwd`"),
     (r'^([^"\'\n]|("[^"\n]*")|(\'[^\'\n]*\'))*\^', "^ must be quoted"),
   ]
 ]
--- a/hgext/histedit.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/histedit.py	Fri Feb 01 15:48:33 2013 -0600
@@ -454,8 +454,12 @@
         if revs:
             revs = [repo.lookup(rev) for rev in revs]
 
-        parent = discovery.findcommonoutgoing(
-            repo, other, [], force=opts.get('force')).missing[0:1]
+        # hexlify nodes from outgoing, because we're going to parse
+        # parent[0] using revsingle below, and if the binary hash
+        # contains special revset characters like ":" the revset
+        # parser can choke.
+        parent = [node.hex(n) for n in discovery.findcommonoutgoing(
+            repo, other, [], force=opts.get('force')).missing[0:1]]
     else:
         if opts.get('force'):
             raise util.Abort(_('--force only allowed with --outgoing'))
--- a/hgext/largefiles/basestore.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/largefiles/basestore.py	Fri Feb 01 15:48:33 2013 -0600
@@ -26,7 +26,7 @@
         self.detail = detail
 
     def longmessage(self):
-        return (_("error getting %s from %s for %s: %s\n") %
+        return (_("error getting id %s from url %s for file %s: %s\n") %
                  (self.hash, self.url, self.filename, self.detail))
 
     def __str__(self):
@@ -67,7 +67,7 @@
             ui.note(_('getting %s:%s\n') % (filename, hash))
 
             storefilename = lfutil.storepath(self.repo, hash)
-            tmpfile = util.atomictempfile(storefilename,
+            tmpfile = util.atomictempfile(storefilename + '.tmp',
                                           createmode=self.repo.store.createmode)
 
             try:
@@ -75,16 +75,17 @@
             except StoreError, err:
                 ui.warn(err.longmessage())
                 hhash = ""
+            tmpfile.close() # has probably already been closed!
 
             if hhash != hash:
                 if hhash != "":
                     ui.warn(_('%s: data corruption (expected %s, got %s)\n')
                             % (filename, hash, hhash))
-                tmpfile.discard() # no-op if it's already closed
+                util.unlink(storefilename + '.tmp')
                 missing.append(filename)
                 continue
 
-            tmpfile.close()
+            util.rename(storefilename + '.tmp', storefilename)
             lfutil.linktousercache(self.repo, hash)
             success.append((filename, hhash))
 
@@ -105,8 +106,9 @@
             cctx = self.repo[rev]
             cset = "%d:%s" % (cctx.rev(), node.short(cctx.node()))
 
-            failed = util.any(self._verifyfile(
-                cctx, cset, contents, standin, verified) for standin in cctx)
+            for standin in cctx:
+                if self._verifyfile(cctx, cset, contents, standin, verified):
+                    failed = True
 
         numrevs = len(verified)
         numlfiles = len(set([fname for (fname, fnode) in verified]))
@@ -163,6 +165,7 @@
             path = ''
             remote = repo
         else:
+            path, _branches = hg.parseurl(path)
             remote = hg.peer(repo, {}, path)
 
     # The path could be a scheme so use Mercurial's normal functionality
--- a/hgext/largefiles/lfutil.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/largefiles/lfutil.py	Fri Feb 01 15:48:33 2013 -0600
@@ -224,13 +224,7 @@
     '''Return a match object that applies pats to the standin directory'''
     standindir = repo.wjoin(shortname)
     if pats:
-        # patterns supplied: search standin directory relative to current dir
-        cwd = repo.getcwd()
-        if os.path.isabs(cwd):
-            # cwd is an absolute path for hg -R <reponame>
-            # work relative to the repository root in this case
-            cwd = ''
-        pats = [os.path.join(standindir, cwd, pat) for pat in pats]
+        pats = [os.path.join(standindir, pat) for pat in pats]
     elif os.path.isdir(standindir):
         # no patterns: relative to repo root
         pats = [standindir]
--- a/hgext/largefiles/overrides.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/largefiles/overrides.py	Fri Feb 01 15:48:33 2013 -0600
@@ -669,18 +669,18 @@
     finally:
         wlock.release()
 
-def hgupdate(orig, repo, node):
-    # Only call updatelfiles the standins that have changed to save time
-    oldstandins = lfutil.getstandinsstate(repo)
-    result = orig(repo, node)
-    newstandins = lfutil.getstandinsstate(repo)
-    filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
-    lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True)
-    return result
+def hgupdaterepo(orig, repo, node, overwrite):
+    if not overwrite:
+        # Only call updatelfiles on the standins that have changed to save time
+        oldstandins = lfutil.getstandinsstate(repo)
 
-def hgclean(orig, repo, node, show_stats=True):
-    result = orig(repo, node, show_stats)
-    lfcommands.updatelfiles(repo.ui, repo)
+    result = orig(repo, node, overwrite)
+
+    filelist = None
+    if not overwrite:
+        newstandins = lfutil.getstandinsstate(repo)
+        filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
+    lfcommands.updatelfiles(repo.ui, repo, filelist=filelist)
     return result
 
 def hgmerge(orig, repo, node, force=None, remind=True):
@@ -1149,10 +1149,25 @@
 
 def overridecat(orig, ui, repo, file1, *pats, **opts):
     ctx = scmutil.revsingle(repo, opts.get('rev'))
-    if not lfutil.standin(file1) in ctx:
-        result = orig(ui, repo, file1, *pats, **opts)
-        return result
-    return lfcommands.catlfile(repo, file1, ctx.rev(), opts.get('output'))
+    err = 1
+    notbad = set()
+    m = scmutil.match(ctx, (file1,) + pats, opts)
+    origmatchfn = m.matchfn
+    def lfmatchfn(f):
+        lf = lfutil.splitstandin(f)
+        if lf is None:
+            return origmatchfn(f)
+        notbad.add(lf)
+        return origmatchfn(lf)
+    m.matchfn = lfmatchfn
+    m.bad = lambda f, msg: f not in notbad
+    for f in ctx.walk(m):
+        lf = lfutil.splitstandin(f)
+        if lf is None:
+            err = orig(ui, repo, f, **opts)
+        else:
+            err = lfcommands.catlfile(repo, lf, ctx.rev(), opts.get('output'))
+    return err
 
 def mercurialsinkbefore(orig, sink):
     sink.repo._isconverting = True
--- a/hgext/largefiles/proto.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/largefiles/proto.py	Fri Feb 01 15:48:33 2013 -0600
@@ -63,18 +63,16 @@
     return wireproto.streamres(generator())
 
 def statlfile(repo, proto, sha):
-    '''Return '2\n' if the largefile is missing, '1\n' if it has a
-    mismatched checksum, or '0\n' if it is in good condition'''
+    '''Return '2\n' if the largefile is missing, '0\n' if it seems to be in
+    good condition.
+
+    The value 1 is reserved for mismatched checksum, but that is too expensive
+    to be verified on every stat and must be caught be running 'hg verify'
+    server side.'''
     filename = lfutil.findfile(repo, sha)
     if not filename:
         return '2\n'
-    fd = None
-    try:
-        fd = open(filename, 'rb')
-        return lfutil.hexsha1(fd) == sha and '0\n' or '1\n'
-    finally:
-        if fd:
-            fd.close()
+    return '0\n'
 
 def wirereposetup(ui, repo):
     class lfileswirerepository(repo.__class__):
--- a/hgext/largefiles/remotestore.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/largefiles/remotestore.py	Fri Feb 01 15:48:33 2013 -0600
@@ -48,11 +48,14 @@
 
     def _getfile(self, tmpfile, filename, hash):
         # quit if the largefile isn't there
-        stat = self._stat(hash)
+        stat = self._stat([hash])[hash]
         if stat == 1:
             raise util.Abort(_('remotestore: largefile %s is invalid') % hash)
         elif stat == 2:
             raise util.Abort(_('remotestore: largefile %s is missing') % hash)
+        elif stat != 0:
+            raise RuntimeError('error getting file: unexpected response from '
+                               'statlfile (%r)' % stat)
 
         try:
             length, infile = self._get(hash)
@@ -74,7 +77,7 @@
         return lfutil.copyandhash(lfutil.blockstream(infile), tmpfile)
 
     def _verify(self, hashes):
-        return self._stat(hashes)
+        return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems())
 
     def _verifyfile(self, cctx, cset, contents, standin, verified):
         filename = lfutil.splitstandin(standin)
@@ -87,7 +90,8 @@
 
         verified.add(key)
 
-        stat = self._stat(hash)
+        expecthash = fctx.data()[0:40]
+        stat = self._stat([expecthash])[expecthash]
         if not stat:
             return False
         elif stat == 1:
--- a/hgext/largefiles/uisetup.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/largefiles/uisetup.py	Fri Feb 01 15:48:33 2013 -0600
@@ -109,11 +109,7 @@
     entry = extensions.wrapfunction(commands, 'revert',
                                     overrides.overriderevert)
 
-    # clone uses hg._update instead of hg.update even though they are the
-    # same function... so wrap both of them)
-    extensions.wrapfunction(hg, 'update', overrides.hgupdate)
-    extensions.wrapfunction(hg, '_update', overrides.hgupdate)
-    extensions.wrapfunction(hg, 'clean', overrides.hgclean)
+    extensions.wrapfunction(hg, 'updaterepo', overrides.hgupdaterepo)
     extensions.wrapfunction(hg, 'merge', overrides.hgmerge)
 
     extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
--- a/hgext/largefiles/wirestore.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/largefiles/wirestore.py	Fri Feb 01 15:48:33 2013 -0600
@@ -26,6 +26,8 @@
         return self.remote.getlfile(hash)
 
     def _stat(self, hashes):
+        '''For each hash, return 2 if the largefile is missing, 1 if it has a
+        mismatched checksum, or 0 if it is in good condition'''
         batch = self.remote.batch()
         futures = {}
         for hash in hashes:
@@ -33,5 +35,5 @@
         batch.submit()
         retval = {}
         for hash in hashes:
-            retval[hash] = not futures[hash].value
+            retval[hash] = futures[hash].value
         return retval
--- a/hgext/rebase.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/hgext/rebase.py	Fri Feb 01 15:48:33 2013 -0600
@@ -68,6 +68,9 @@
     same rebase or they will end up with duplicated changesets after
     pulling in your rebased changesets.
 
+    In its default configuration, Mercurial will prevent you from
+    rebasing published changes. See :hg:`help phases` for details.
+
     If you don't specify a destination changeset (``-d/--dest``),
     rebase uses the tipmost head of the current named branch as the
     destination. (The destination changeset is not modified by
@@ -85,6 +88,11 @@
     the whole branch. If you specify neither ``-s`` nor ``-b``, rebase
     uses the parent of the working directory as the base.
 
+    For advanced usage, a third way is available through the ``--rev``
+    option. It allows you to specify an arbitrary set of changesets to
+    rebase. Descendants of revs you specify with this option are not
+    automatically included in the rebase.
+
     By default, rebase recreates the changesets in the source branch
     as descendants of dest and then destroys the originals. Use
     ``--keep`` to preserve the original source changesets. Some
@@ -316,7 +324,7 @@
             clearrebased(ui, repo, state, skipped, collapsedas)
 
         if currentbookmarks:
-            updatebookmarks(repo, nstate, currentbookmarks, **opts)
+            updatebookmarks(repo, dest, nstate, currentbookmarks)
 
         clearstatus(repo)
         ui.note(_("rebase completed\n"))
@@ -493,14 +501,15 @@
         mq.seriesdirty = True
         mq.savedirty()
 
-def updatebookmarks(repo, nstate, originalbookmarks, **opts):
-    'Move bookmarks to their correct changesets'
+def updatebookmarks(repo, dest, nstate, originalbookmarks):
+    'Move bookmarks to their correct changesets, and delete divergent ones'
+    destnode = dest.node()
     marks = repo._bookmarks
     for k, v in originalbookmarks.iteritems():
         if v in nstate:
-            if nstate[v] > nullmerge:
-                # update the bookmarks for revs that have moved
-                marks[k] = nstate[v]
+            # update the bookmarks for revs that have moved
+            marks[k] = nstate[v]
+            bookmarks.deletedivergent(repo, [destnode], k)
 
     marks.write()
 
--- a/i18n/ja.po	Sat Jan 19 17:20:39 2013 -0600
+++ b/i18n/ja.po	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 # Japanese translation for Mercurial
 # Mercurial 日本語翻訳
 #
-# Copyright (C) 2009-2012 the Mercurial team
+# Copyright (C) 2009-2013 the Mercurial team
 #
 # ========================================
 # 【翻訳用語集】
@@ -55,6 +55,7 @@
 # change                チェンジセット/差分
 # changegroup( file)    バンドルファイル
 # changeset             リビジョン (or 「チェンジセット」/「変更内容」)
+# changeset description コミットログ
 # changeset hash        ハッシュ値
 # changeset header      ヘッダ情報
 # changeset log         コミットログ
@@ -64,9 +65,11 @@
 # commit                コミット
 # commit comment        コミットログ
 # commit message        コミットログ
+# commit text           コミットログ
 # copy(of file, repo)   複製
 # default(, by)         指定が無い場合/通常は
 # delete                (作業領域からの)ファイル削除
+# description(, changeset) コミットログ
 # diff                  差分
 # directory             ディレクトリ
 # dirstate              dirstate
@@ -122,6 +125,7 @@
 # support(, not)        (未)サポート
 # support(, un)         (未)サポート
 # tag                   タグ
+# topological xxxx      構造的
 # tracked xxxx          構成管理対象の xxxx
 # tracked, un           未登録
 # type, xxxxx           xxxx 種別
@@ -135,7 +139,7 @@
 msgstr ""
 "Project-Id-Version: Mercurial\n"
 "Report-Msgid-Bugs-To: <mercurial-devel@selenic.com>\n"
-"POT-Creation-Date: 2012-11-30 17:45+0900\n"
+"POT-Creation-Date: 2013-01-31 18:04+0900\n"
 "PO-Revision-Date: 2009-11-16 21:24+0100\n"
 "Last-Translator: Japanese translation team <mercurial-ja@googlegroups.com>\n"
 "Language-Team: Japanese\n"
@@ -1642,6 +1646,10 @@
 msgid "ignoring unknown color/effect %r (configured in color.%s)\n"
 msgstr "未知の色/効果指定 %r を無視(color.%s で設定記述)\n"
 
+#. i18n: "label" is a keyword
+msgid "label expects two arguments"
+msgstr "label の引数は2つです"
+
 #. i18n: 'always', 'auto', and 'never' are keywords and should
 #. not be translated
 msgid "when to colorize (boolean, always, auto, or never)"
@@ -1970,8 +1978,8 @@
 "    :convert.cvsps.cache: Set to False to disable remote log caching,\n"
 "        for testing and debugging purposes. Default is True."
 msgstr ""
-"    :convert.cvsps.cache: リモートログのキャッシュを抑止します\n"
-"        (試験およびデバッグ用)。 デフォルト値は True。"
+"    :convert.cvsps.cache: (試験およびデバッグ用) False 設定により、\n"
+"        リモートログのキャッシュを抑止します。 デフォルト値は True。"
 
 msgid ""
 "    :convert.cvsps.fuzz: Specify the maximum time (in seconds) that is\n"
@@ -2011,22 +2019,31 @@
 "        デフォルト値は ``{{mergefrombranch ([-\\w]+)}}``"
 
 msgid ""
-"    :hook.cvslog: Specify a Python function to be called at the end of\n"
+"    :convert.localtimezone: use local time (as determined by the TZ\n"
+"        environment variable) for changeset date/times. The default\n"
+"        is False (use UTC)."
+msgstr ""
+"    :convert.localtimezone: 新規リビジョンの作成日時情報に、 実行環境の、\n"
+"        タイムゾーンを使用します (TZ 環境変数から推定)。 デフォルト値は\n"
+"        False です (UTC として扱います)。"
+
+msgid ""
+"    :hooks.cvslog: Specify a Python function to be called at the end of\n"
 "        gathering the CVS log. The function is passed a list with the\n"
 "        log entries, and can modify the entries in-place, or add or\n"
 "        delete them."
 msgstr ""
-"    :hook.cvslog: CVS のログ収集処理後に呼ばれる Python 関数。\n"
+"    :hooks.cvslog: CVS のログ収集処理後に呼ばれる Python 関数。\n"
 "        関数呼び出しの際には、 ログエントリの一覧が渡され、\n"
 "        一覧要素の改変や、 追加/削除を、 直接実施できます。"
 
 msgid ""
-"    :hook.cvschangesets: Specify a Python function to be called after\n"
+"    :hooks.cvschangesets: Specify a Python function to be called after\n"
 "        the changesets are calculated from the CVS log. The\n"
 "        function is passed a list with the changeset entries, and can\n"
 "        modify the changesets in-place, or add or delete them."
 msgstr ""
-"    :hook.cvschangesets: CVS ログからのリビジョン算出完了後に呼ばれる\n"
+"    :hooks.cvschangesets: CVS ログからのリビジョン算出完了後に呼ばれる\n"
 "        Python 関数。 関数呼び出しの際には、 リビジョン一覧が渡され、\n"
 "        リビジョンの改変や、 追加/削除を、 直接実施できます。"
 
@@ -2463,6 +2480,9 @@
 msgid "reading cvs log cache %s\n"
 msgstr "CVS ログキャッシュ %s 読み込み中\n"
 
+msgid "ignoring old cache\n"
+msgstr "古いログキャッシュを無視します\n"
+
 #, python-format
 msgid "cache has %d log entries\n"
 msgstr "キャッシュには %d 件のログエントリがあります\n"
@@ -2573,6 +2593,10 @@
 msgstr "%r オブジェクトが %s から読み込めません"
 
 #, python-format
+msgid "cannot read submodules config file in %s"
+msgstr "%s におけるサブモジュールの設定ファイルが読み込めません"
+
+#, python-format
 msgid "cannot read changes in %s"
 msgstr "%s の変更を読み込めません"
 
@@ -2708,8 +2732,8 @@
 "svn: cannot probe remote repository, assume it could be a subversion "
 "repository. Use --source-type if you know better.\n"
 msgstr ""
-"svn: subversion の連携先リポジトリの確認に失敗しました。 --source-type の使用"
-"を検討してください。\n"
+"svn: 連携先リポジトリの確認に失敗しました。連携先を subversion リポジトリと仮"
+"定します。他の形式の場合は --source-type を使用してください。\n"
 
 #, python-format
 msgid "%s does not look like a Subversion repository"
@@ -3550,9 +3574,6 @@
 msgid "do not display revision or any of its ancestors"
 msgstr "当該リビジョンとその祖先の表示を抑止"
 
-msgid "show hidden changesets (DEPRECATED)"
-msgstr "隠れたリビジョンの表示 (DEPRECATED)"
-
 msgid "[OPTION]... [FILE]"
 msgstr "[OPTION]... [FILE]"
 
@@ -3889,7 +3910,7 @@
 " pick 7c2fd3b9020c Add delta"
 
 msgid ""
-" # Edit history between 633536316234 and 7c2fd3b9020c\n"
+" # Edit history between c561b4e977df and 7c2fd3b9020c\n"
 " #\n"
 " # Commands:\n"
 " #  p, pick = use commit\n"
@@ -3900,7 +3921,7 @@
 " #  m, mess = edit message without changing commit content\n"
 " #"
 msgstr ""
-" # 633536316234 から 7c2fd3b9020c にかけての履歴の編集\n"
+" # c561b4e977df から 7c2fd3b9020c にかけての履歴の編集\n"
 " #\n"
 " # 指定可能コマンド:\n"
 " #  p, pick = リビジョンを採用\n"
@@ -4050,11 +4071,10 @@
 "履歴は改変前の状態に戻ります。"
 
 msgid ""
-"If we clone the example repository above and add three more changes, such "
-"that\n"
-"we have the following history::"
-msgstr ""
-"上記の実行例におけるリポジトリを複製し、 そこで履歴を3つ追加した結果、\n"
+"If we clone the histedit-ed example repository above and add four more\n"
+"changes, such that we have the following history::"
+msgstr ""
+"改変済みの実行例リポジトリを複製し、 そこで履歴を4つ追加した結果、\n"
 "以下の様な履歴になったものと仮定します::"
 
 msgid ""
@@ -4124,16 +4144,16 @@
 "#  m, mess = edit message without changing commit content\n"
 "#\n"
 msgstr ""
-" # %s から %s にかけての履歴の編集\n"
-" #\n"
-" # 指定可能コマンド:\n"
-" #  p, pick = リビジョンを採用\n"
-" #  e, edit = リビジョンを採用: 但し修正のために一旦実行を中断\n"
-" #  f, fold = リビジョンを採用: 但し直前のリビジョンに併合\n"
-" #            (このリビジョンが N 番目なら、N - 1 番目に併合)\n"
-" #  d, drop = リビジョンを破棄\n"
-" #  m, mess = 改変内容を維持しつつ、コミットログを修正\n"
-" #\n"
+"# %s から %s にかけての履歴の編集\n"
+"#\n"
+"# 指定可能コマンド:\n"
+"#  p, pick = リビジョンを採用\n"
+"#  e, edit = リビジョンを採用: 但し修正のために一旦実行を中断\n"
+"#  f, fold = リビジョンを採用: 但し直前のリビジョンに併合\n"
+"#            (このリビジョンが N 番目なら、N - 1 番目に併合)\n"
+"#  d, drop = リビジョンを破棄\n"
+"#  m, mess = 改変内容を維持しつつ、コミットログを修正\n"
+"#\n"
 
 msgid "Fix up the change and run hg histedit --continue"
 msgstr "衝突解消後に \"hg histedit --continue\" してください"
@@ -4396,12 +4416,6 @@
 msgid "cannot start: socket is already bound"
 msgstr "ソケットが既にバインドされているため開始できません"
 
-msgid ""
-"cannot start: tried linking .hg/inotify.sock to a temporary socket but .hg/"
-"inotify.sock already exists"
-msgstr ""
-"一時ソケットに使用する .hg/inotify.sock が既に存在するため開始できません"
-
 #, python-format
 msgid "answering query for %r\n"
 msgstr "%r への問い合わせに返答中\n"
@@ -4570,7 +4584,7 @@
 msgstr ""
 "複数行に渡る展開や、 CVS の $Log$ のような増加する内容の展開は\n"
 "未サポートです。 キーワードテンプレート設定 \"Log = {desc}\" は、\n"
-"コミットメッセージの最初の一行を埋め込みます。\n"
+"コミットログの最初の一行を埋め込みます。\n"
 
 #, python-format
 msgid "overwriting %s expanding keywords\n"
@@ -4984,6 +4998,10 @@
 "    --to-normal を指定します。 変換後リポジトリは、 largefiles\n"
 "    エクステンション無しでも使用できます。"
 
+#, python-format
+msgid "error getting id %s from url %s for file %s: %s\n"
+msgstr "識別子 %s (連携先 %s のファイル %s) に対するエラー: %s\n"
+
 msgid "getting largefiles"
 msgstr "大容量ファイルの取得中"
 
@@ -5139,17 +5157,17 @@
 msgstr "ファイル名指定がありません"
 
 #, python-format
-msgid "not removing %s: %s (use forget to undo)\n"
-msgstr "%s は削除されません: %s (取り消し機能は forget)\n"
-
-msgid "file still exists"
-msgstr "ファイルは維持されます"
-
-msgid "file is modified"
-msgstr "ファイルは改変されています"
-
-msgid "file has been marked for add"
-msgstr "追加登録予定のファイルです"
+msgid "not removing %s: file still exists\n"
+msgstr "%s は削除されません: ファイルは維持されます\n"
+
+#, python-format
+msgid "not removing %s: file is modified (use -f to force removal)\n"
+msgstr ""
+"%s は削除されません: ファイルは改変されています(削除の強行は -f を指定)\n"
+
+#, python-format
+msgid "not removing %s: file has been marked for add (use forget to undo)\n"
+msgstr "%s は削除されません: 追加登録対象ファイルです (取り消しは forget)\n"
 
 #, python-format
 msgid "removing %s\n"
@@ -5346,6 +5364,9 @@
 msgid "verify largefile contents not just existence"
 msgstr "大容量ファイルの存在確認以外に、 内容の検証も実施"
 
+msgid "display largefiles dirstate"
+msgstr "大容量ファイルの作業領域状態を表示"
+
 msgid "display outgoing largefiles"
 msgstr "転送対象大容量ファイルを表示"
 
@@ -6471,7 +6492,7 @@
 msgstr "パッチに記録された親リビジョンに対して適用"
 
 msgid "list patch name in commit text"
-msgstr "コミットメッセージとしてパッチ名を列挙"
+msgstr "コミットログとしてパッチ名を列挙"
 
 msgid "apply all patches"
 msgstr "全てのパッチを適用"
@@ -7428,15 +7449,15 @@
 "message contains two or three body parts:"
 msgstr ""
 "個々のメールの Subject ヘッダは、 \"[PATCH M of N]\" で始まり、 対応する\n"
-"リビジョンのコミットメッセージの最初の行の内容が記載されます。 メールの\n"
-"本文は、 以下の様な2ないし3の部位から構成されます:"
+"リビジョンのコミットログの最初の行の内容が記載されます。 メールの本文は、\n"
+"以下の様な2ないし3の部位から構成されます:"
 
 msgid ""
 "- The changeset description.\n"
 "- [Optional] The result of running diffstat on the patch.\n"
 "- The patch itself, as generated by :hg:`export`."
 msgstr ""
-"- コミットメッセージ\n"
+"- コミットログ\n"
 "- パッチの差分統計(diffstat)結果 [省略可能]\n"
 "- :hg:`export` 形式と同様のパッチ内容"
 
@@ -7596,9 +7617,9 @@
 "    description."
 msgstr ""
 "    個々のメールの Subject ヘッダは、 \"[PATCH M of N]\" で始まり、\n"
-"    対応するリビジョンのコミットメッセージの1行目が記載されます。\n"
+"    対応するリビジョンのコミットログの1行目が記載されます。\n"
 "    メール本文は、 2ないし3の部位から構成されます。\n"
-"    最初の部位にはコミットメッセージの続きが配置されます。"
+"    最初の部位にはコミットログの続きが配置されます。"
 
 msgid ""
 "    With the -d/--diffstat option, if the diffstat program is\n"
@@ -8245,9 +8266,6 @@
 msgid "no matching revisions"
 msgstr "合致するリビジョンはありません"
 
-msgid "can't rebase multiple roots"
-msgstr "複数リビジョン由来のリビジョンは移動できません"
-
 msgid "source is ancestor of destination"
 msgstr "移動元は移動先の祖先です"
 
@@ -9225,9 +9243,8 @@
 msgid "unknown parent"
 msgstr "未知の親"
 
-#, python-format
-msgid "integrity check failed on %s:%d"
-msgstr "%s:%d の一貫性チェックに失敗"
+msgid "unknown delta base"
+msgstr "未知の差分ベース"
 
 msgid "cannot create new bundle repository"
 msgstr "バンドルリポジトリの新規作成はできません"
@@ -9608,6 +9625,9 @@
 msgid "display help and exit"
 msgstr "ヘルプ情報を表示して終了"
 
+msgid "consider hidden changesets"
+msgstr "不可視状態のリビジョンも対象に含める"
+
 msgid "do not perform actions, just print output"
 msgstr "実施予定の処理内容の表示のみで処理実施は抑止"
 
@@ -10156,6 +10176,15 @@
 "          hg bisect --skip\n"
 "          hg bisect --skip 23"
 
+msgid ""
+"      - skip all revisions that do not touch directories ``foo`` or ``bar``"
+msgstr "      - ``foo`` と ``bar`` の両方を改変したリビジョン以外をスキップ::"
+
+msgid ""
+"          hg bisect --skip '!( file(\"path:foo\") & file(\"path:bar\") )'"
+msgstr ""
+"          hg bisect --skip '!( file(\"path:foo\") & file(\"path:bar\") )'"
+
 msgid "      - forget the current bisection::"
 msgstr "      - 現行の検索状態をクリア::"
 
@@ -10333,6 +10362,15 @@
 "    bookmarks エクステンションを有効にしてください。"
 
 msgid ""
+"    If you set a bookmark called '@', new clones of the repository will\n"
+"    have that revision checked out (and the bookmark made active) by\n"
+"    default."
+msgstr ""
+"    ブックマーク '@' が設定されている場合、 特に指定がなければ、\n"
+"    複製先の作業領域は、 そのリビジョンで更新されます (ブックマーク '@'\n"
+"    はアクティブになります)"
+
+msgid ""
 "    With -i/--inactive, the new bookmark will not be made the active\n"
 "    bookmark. If -r/--rev is given, the new bookmark will not be made\n"
 "    active even if -i/--inactive is not given. If no NAME is given, the\n"
@@ -10692,6 +10730,13 @@
 "    タグ「実施」リビジョンは、 複製先に取り込まれません。"
 
 msgid ""
+"    If the source repository has a bookmark called '@' set, that\n"
+"    revision will be checked out in the new repository by default."
+msgstr ""
+"    複製元リポジトリにブックマーク '@' が設定されている場合、\n"
+"    特に指定がなければ、 複製先の作業領域は、 そのリビジョンで更新されます。"
+
+msgid ""
 "    To check out a particular version, use -u/--update, or\n"
 "    -U/--noupdate to create a clone with no working directory."
 msgstr ""
@@ -10755,8 +10800,9 @@
 "      d) the changeset specified with -r\n"
 "      e) the tipmost head specified with -b\n"
 "      f) the tipmost head specified with the url#branch source syntax\n"
-"      g) the tipmost head of the default branch\n"
-"      h) tip"
+"      g) the revision marked with the '@' bookmark, if present\n"
+"      h) the tipmost head of the default branch\n"
+"      i) tip"
 msgstr ""
 "      a) -U が指定されるか、 元リポジトリ履歴が空の場合は null リビジョン\n"
 "      b) -u . が指定され、 且つ元リポジトリが同一ホストの場合、\n"
@@ -10766,8 +10812,9 @@
 "      d) -r で指定されたリビジョン\n"
 "      e) -b で指定sれたブランチの最新ヘッドリビジョン\n"
 "      f) url#branch 形式で指定されたブランチの最新ヘッドリビジョン\n"
-"      g) default ブランチの最新ヘッドリビジョン\n"
-"      h) tip"
+"      g) ブックマーク '@' が存在する場合は、そのリビジョン\n"
+"      h) default ブランチの最新ヘッドリビジョン\n"
+"      i) tip"
 
 msgid "      - clone a remote repository to a new directory named hg/::"
 msgstr "      - 遠隔ホストのリポジトリを、 新規 hg/ ディレクトリ配下に複製::"
@@ -11292,7 +11339,7 @@
 msgstr " エディタが起動できません(vi にも PATH が通っていません)\n"
 
 msgid " (specify a commit editor in your configuration file)\n"
-msgstr " (コミットメッセージ用エディタを設定ファイルで設定してください)\n"
+msgstr " (コミットログ用エディタを設定ファイルで設定してください)\n"
 
 #, python-format
 msgid " Can't find editor '%s' in PATH\n"
@@ -11450,6 +11497,62 @@
 msgid "revision to check"
 msgstr "確認対象リビジョン"
 
+msgid "[REV]"
+msgstr "[REV]"
+
+msgid "show set of successors for revision"
+msgstr "指定リビジョンの後継リビジョン群の表示"
+
+msgid ""
+"    A successors set of changeset A is a consistent group of revisions that\n"
+"    succeed A. It contains non-obsolete changesets only."
+msgstr ""
+
+msgid ""
+"    In most cases a changeset A has a single successors set containing a "
+"single\n"
+"    successor (changeset A replaced by A')."
+msgstr ""
+
+msgid ""
+"    A changeset that is made obsolete with no successors are called \"pruned"
+"\".\n"
+"    Such changesets have no successors sets at all."
+msgstr ""
+
+msgid ""
+"    A changeset that has been \"split\" will have a successors set "
+"containing\n"
+"    more than one successor."
+msgstr ""
+
+msgid ""
+"    A changeset that has been rewritten in multiple different ways is "
+"called\n"
+"    \"divergent\". Such changesets have multiple successor sets (each of "
+"which\n"
+"    may also be split, i.e. have multiple successors)."
+msgstr ""
+
+msgid "    Results are displayed as follows::"
+msgstr ""
+
+msgid ""
+"        <rev1>\n"
+"            <successors-1A>\n"
+"        <rev2>\n"
+"            <successors-2A>\n"
+"            <successors-2B1> <successors-2B2> <successors-2B3>"
+msgstr ""
+
+msgid ""
+"    Here rev2 has two possible (i.e. divergent) successors sets. The first\n"
+"    holds one element, whereas the second holds three (i.e. the changeset "
+"has\n"
+"    been split).\n"
+"    "
+msgstr ""
+
 msgid "show how files match on given patterns"
 msgstr "指定パターンへのファイル合致状況の表示"
 
@@ -11899,7 +12002,7 @@
 msgstr "指定リビジョンの子孫となるヘッドのみを表示"
 
 msgid "show topological heads only"
-msgstr "子を持たない全てのリビジョンを表示"
+msgstr "構造的なヘッドのみを表示"
 
 msgid "show active branchheads only (DEPRECATED)"
 msgstr "アクティブなブランチヘッドのみを表示 (非推奨)"
@@ -12567,7 +12670,7 @@
 "       --removed を指定してください。"
 
 msgid "      - changesets with full descriptions and file lists::"
-msgstr "      - 全リビジョンのコミットメッセージとファイル一覧の表示::"
+msgstr "      - 全リビジョンのコミットログとファイル一覧の表示::"
 
 msgid "          hg log -v"
 msgstr "          hg log -v"
@@ -13268,19 +13371,6 @@
 msgid "not removing %s: file is untracked\n"
 msgstr "%s は削除されません: 未登録ファイルです\n"
 
-#, python-format
-msgid "not removing %s: file still exists (use -f to force removal)\n"
-msgstr "%s は削除されません: ファイルは保持されます(削除の強行は -f を指定)\n"
-
-#, python-format
-msgid "not removing %s: file is modified (use -f to force removal)\n"
-msgstr ""
-"%s は削除されません: ファイルは改変されています(削除の強行は -f を指定)\n"
-
-#, python-format
-msgid "not removing %s: file has been marked for add (use forget to undo)\n"
-msgstr "%s は削除されません: 追加登録対象ファイルです (取り消しは forget)\n"
-
 msgid "record a rename that has already occurred"
 msgstr "手動で改名済みのファイルに対して、 改名の旨を記録"
 
@@ -14264,6 +14354,10 @@
 "    特定のファイルだけを以前の状態に戻す場合は、\n"
 "    :hg:`revert [-r リビジョン] ファイル名` を使用してください。"
 
+#, python-format
+msgid "updating to active bookmark %s\n"
+msgstr "アクティブなブックマーク %s への更新中\n"
+
 msgid "cannot specify both -c/--check and -C/--clean"
 msgstr "-c/--check と -C/--clean は併用できません"
 
@@ -14325,13 +14419,13 @@
 msgstr "%s を読み込めません(%s)"
 
 #, python-format
+msgid "unknown revision '%s'"
+msgstr "'%s' は未知のリビジョンです"
+
+#, python-format
 msgid "working directory has unknown parent '%s'!"
 msgstr "作業領域の親 '%s' が未知のリビジョンです!"
 
-#, python-format
-msgid "unknown revision '%s'"
-msgstr "'%s' は未知のリビジョンです"
-
 msgid "not found in manifest"
 msgstr "マニフェストにありません"
 
@@ -14547,6 +14641,10 @@
 msgid "broken pipe\n"
 msgstr "パイプ破壊(EPIPE)\n"
 
+#, python-format
+msgid "abort: %s: '%s'\n"
+msgstr "中断: %s: '%s'\n"
+
 msgid "interrupted!\n"
 msgstr "中断されました!\n"
 
@@ -14770,6 +14868,10 @@
 msgid "merging %s incomplete! (edit conflicts, then use 'hg resolve --mark')\n"
 msgstr "%s のマージは不完全です (衝突解消後に 'hg resolve --mark' が必要)\n"
 
+#, python-format
+msgid "warning: internal:merge cannot merge symlinks for %s\n"
+msgstr "警告: internal:merge はシンボリックリンク %s のマージができません\n"
+
 msgid ""
 "``internal:dump``\n"
 "Creates three versions of the files to merge, containing the\n"
@@ -17010,24 +17112,6 @@
 "    ツールの戻り値がマージ成功を示す場合でも、 常にマージ成否を問い合わせ。"
 
 msgid ""
-"``checkchanged``\n"
-"  True is equivalent to ``check = changed``.\n"
-"  Default: False"
-msgstr ""
-"``checkchanged``\n"
-"  本設定を True にするのは、 ``check = changed`` 設定と等価です。\n"
-"  デフォルト値: False"
-
-msgid ""
-"``checkconflicts``\n"
-"  True is equivalent to ``check = conflicts``.\n"
-"  Default: False"
-msgstr ""
-"``checkconflicts``\n"
-"  本設定を True にするのは、 ``check = conflicts`` 設定と等価です。\n"
-"  デフォルト値: False"
-
-msgid ""
 "``fixeol``\n"
 "  Attempt to fix up EOL changes caused by the merge tool.\n"
 "  Default: False"
@@ -17335,6 +17419,29 @@
 "    デフォルト値: None (結果は標準エラー出力から出力)"
 
 msgid ""
+"``sort``\n"
+"    Sort field.  Specific to the ``ls`` instrumenting profiler.\n"
+"    One of ``callcount``, ``reccallcount``, ``totaltime`` and\n"
+"    ``inlinetime``.\n"
+"    Default: inlinetime."
+msgstr ""
+"``sort``\n"
+"    出力の整列。 詳細プロファイラ ``ls`` 固有の設定。\n"
+"    ``callcount``, ``reccallcount``, ``totaltime`` または ``inlinetime``\n"
+"    から1つを指定してください。 デフォルト値: inlinetime"
+
+msgid ""
+"``nested``\n"
+"    Show at most this number of lines of drill-down info in a tree "
+"structure\n"
+"    after each main entry. This can help explain the difference between "
+"Total\n"
+"    and Inline.\n"
+"    Specific to the ``ls`` instrumenting profiler.\n"
+"    Default: 5."
+msgstr ""
+
+msgid ""
 "``revsetalias``\n"
 "---------------"
 msgstr ""
@@ -17993,6 +18100,15 @@
 "    デフォルト値: False"
 
 msgid ""
+"``archivesubrepos``\n"
+"    Whether to recurse into subrepositories when archiving. Default is\n"
+"    False."
+msgstr ""
+"``archivesubrepos``\n"
+"    アーカイブ作成における、 サブリポジトリへの再帰実施の有無。\n"
+"    デフォルト値: False"
+
+msgid ""
 "``baseurl``\n"
 "    Base URL to use when publishing URLs in other locations, so\n"
 "    third-party tools like email notification hooks can construct\n"
@@ -18512,8 +18628,8 @@
 msgstr ""
 "HGENCODING\n"
 "    Mercurial によるロケール自動検出の上書き。 この設定は、 ユーザ名、\n"
-"    コミットメッセージ、 タグ名およびブランチ名を内部データ形式に変換する\n"
-"    際に使用されます。 この環境変数設定は、 コマンドラインでの --encoding\n"
+"    コミットログ、 タグ名およびブランチ名の、 記録の際に使用されます。\n"
+"    この環境変数設定は、 コマンドラインでの --encoding\n"
 "    使用により、 更に上書きすることができます。"
 
 msgid ""
@@ -18942,8 +19058,8 @@
 "Branch\n"
 "    (名詞) [ブランチ] ヘッドではない (= 他に子リビジョンを持つ)\n"
 "    リビジョンを親として、 作成された子リビジョン。\n"
-"    これは 「位相的 (topological) ブランチ」 と呼ばれます。\n"
-"    ('Branch, topological' 参照) 位相的ブランチが名前を持つ場合は\n"
+"    これは 「構造的 (topological) ブランチ」 と呼ばれます。\n"
+"    ('Branch, topological' 参照) 構造的ブランチが名前を持つ場合は\n"
 "    「名前付きブランチ」、 名前を持たない場合は「名前無しブランチ」\n"
 "    と呼ばれます。 (※ 訳注: 名前を「持つ/持たない」は、\n"
 "    「親と異なる名前」を持つ/持たない、 を意味します)\n"
@@ -19028,7 +19144,7 @@
 "    :hg:`branches --active`."
 msgstr ""
 "Branch, inactive\n"
-"    [非アクティブなブランチ] 位相的なヘッドが無い名前付きブランチは、\n"
+"    [非アクティブなブランチ] 構造的なヘッドが無い名前付きブランチは、\n"
 "    非アクティブなブランチとみなされます。 例えば default ブランチに、\n"
 "    機能実装用の名前付きブランチがマージされると、 機能実装用ブランチは、\n"
 "    非アクティブになります。 :hg:`branches` は、 --active 指定が無い場合、\n"
@@ -19072,10 +19188,10 @@
 msgstr ""
 "    名前付きブランチは、 リポジトリの履歴を構成するリビジョン群を、\n"
 "    重複の無い部分集合へと分割する、 名前空間の一種とも言えます。\n"
-"    名前付きブランチは、 必ずしも位相的ブランチである必要はありません。\n"
+"    名前付きブランチは、 必ずしも構造的ブランチである必要はありません。\n"
 "    ある名前付きブランチ (default でも可) のヘッドとなるリビジョンを親に、\n"
 "    別の名前付きブランチを新規生成した場合、 元ブランチに対して、\n"
-"    以後の新規リビジョン追加が無ければ、 元ブランチは (位相的な意味で)\n"
+"    以後の新規リビジョン追加が無ければ、 元ブランチは (構造的な意味で)\n"
 "    『分岐』したのではなく、 名前が付いているだけと言えます。"
 
 msgid ""
@@ -19094,11 +19210,11 @@
 "    current, possibly default, branch."
 msgstr ""
 "Branch, topological\n"
-"    [位相的ブランチ] ヘッドではない (= 他に子リビジョンを持つ)\n"
+"    [構造的ブランチ] ヘッドではない (= 他に子リビジョンを持つ)\n"
 "    リビジョンを親として、 新規に作成されたリビジョンは、 \n"
-"    位相的ブランチとなります。 位相的ブランチに名前が与えられた場合、\n"
+"    構造的ブランチとなります。 構造的ブランチに名前が与えられた場合、\n"
 "    それは名前付きブランチとなります。 (※ 訳注: 名前付きブランチは、\n"
-"    必ずしも位相的ブランチとは限りません) 名前が与えられない場合は、\n"
+"    必ずしも構造的ブランチとは限りません) 名前が与えられない場合は、\n"
 "    現行の名前付きブランチ (一般的には default) における、\n"
 "    名前無しブランチとなります。"
 
@@ -19434,14 +19550,14 @@
 "    A topological head which has not been closed."
 msgstr ""
 "Head, repository\n"
-"    [リポジトリ(の)ヘッド] 閉鎖されていない、 位相的なヘッド。"
+"    [リポジトリ(の)ヘッド] 閉鎖されていない、 構造的なヘッド。"
 
 msgid ""
 "Head, topological\n"
 "    A changeset with no children in the repository."
 msgstr ""
 "Head, topological\n"
-"    [位相的(な)ヘッド] リポジトリ内に、 子を持たないリビジョン。"
+"    [構造的(な)ヘッド] リポジトリ内に、 子を持たないリビジョン。"
 
 msgid ""
 "History, immutable\n"
@@ -20905,11 +21021,9 @@
 "  時点の内容に含まれないもの::"
 
 msgid ""
-"    hg log -r \"(keyword(bug) or keyword(issue)) and not ancestors(tagged"
-"())\"\n"
-msgstr ""
-"    hg log -r \"(keyword(bug) or keyword(issue)) and not ancestors(tagged"
-"())\"\n"
+"    hg log -r \"(keyword(bug) or keyword(issue)) and not ancestors(tag())\"\n"
+msgstr ""
+"    hg log -r \"(keyword(bug) or keyword(issue)) and not ancestors(tag())\"\n"
 
 msgid ""
 "Subrepositories let you nest external repositories or projects into a\n"
@@ -21312,8 +21426,104 @@
 msgid "List of filters:"
 msgstr "フィルター一覧(入力と、 それに対する出力):"
 
-msgid ".. filtersmarker\n"
-msgstr ".. filtersmarker\n"
+msgid ".. filtersmarker"
+msgstr ".. filtersmarker"
+
+msgid ""
+"Note that a filter is nothing more than a function call, i.e.\n"
+"``expr|filter`` is equivalent to ``filter(expr)``."
+msgstr ""
+"フィルタは関数呼び出しに過ぎません。 例えば、 ``expr|filter`` は\n"
+"``filter(expr)`` と等価です。"
+
+msgid "In addition to filters, there are some basic built-in functions:"
+msgstr "フィルタの他に、 以下の様な基本的な組み込み関数があります:"
+
+msgid "- if(expr, then[, else])"
+msgstr "- if(expr, then[, else])"
+
+msgid "- ifeq(expr, expr, then[, else])"
+msgstr "- ifeq(expr, expr, then[, else])"
+
+msgid "- sub(pat, repl, expr)"
+msgstr "- sub(pat, repl, expr)"
+
+msgid "- join(list, sep)"
+msgstr "- join(list, sep)"
+
+msgid "- label(label, expr)"
+msgstr "- label(label, expr)"
+
+msgid "- date(date[, fmt])"
+msgstr "- date(date[, fmt])"
+
+msgid "- fill(text[, width])"
+msgstr "- fill(text[, width])"
+
+msgid "Also, for any expression that returns a list, there is a list operator:"
+msgstr "また、 列挙形式を返す expr に対しては、 以下の様な記述が可能です:"
+
+msgid "- expr % \"{template}\""
+msgstr "- expr % \"{template}\""
+
+msgid "Some sample command line templates:"
+msgstr "コマンドラインでのテンプレート指定例:"
+
+msgid "- Format lists, e.g. files::"
+msgstr "- files のような列挙形式の整形::"
+
+msgid "   $ hg log -r 0 --template \"files:\\n{files % '  {file}\\n'}\""
+msgstr "   $ hg log -r 0 --template \"files:\\n{files % '  {file}\\n'}\""
+
+msgid "- Join the list of files with a \", \"::"
+msgstr "- ファイル一覧を \", \" で連結::"
+
+msgid "   $ hg log -r 0 --template \"files: {join(files, ', ')}\\n\""
+msgstr "   $ hg log -r 0 --template \"files: {join(files, ', ')}\\n\""
+
+msgid "- Format date::"
+msgstr "- 日時情報の整形::"
+
+msgid "   $ hg log -r 0 --template \"{date(date, '%Y')}\\n\""
+msgstr "   $ hg log -r 0 --template \"{date(date, '%Y')}\\n\""
+
+msgid "- Output the description set to a fill-width of 30::"
+msgstr "- コミットログの各行を30桁で揃えて出力::"
+
+msgid "   $ hg log -r 0 --template \"{fill(desc, '30')}\""
+msgstr "   $ hg log -r 0 --template \"{fill(desc, '30')}\""
+
+msgid "- Use a conditional to test for the default branch::"
+msgstr "- default ブランチか否かで表示内容を切り替え::"
+
+msgid ""
+"   $ hg log -r 0 --template \"{ifeq(branch, 'default', 'on the main "
+"branch',\n"
+"   'on branch {branch}')}\\n\""
+msgstr ""
+"   $ hg log -r 0 --template \"{ifeq(branch, 'default', 'on the main "
+"branch',\n"
+"   'on branch {branch}')}\\n\""
+
+msgid "- Append a newline if not empty::"
+msgstr "- 空でない場合は改行を追加::"
+
+msgid "   $ hg tip --template \"{if(author, '{author}\\n')}\""
+msgstr "   $ hg tip --template \"{if(author, '{author}\\n')}\""
+
+msgid "- Label the output for use with the color extension::"
+msgstr "- color エクステンション向けに、出力をラベル付け::"
+
+msgid ""
+"   $ hg log -r 0 --template \"{label('changeset.{phase}', node|short)}\\n\""
+msgstr ""
+"   $ hg log -r 0 --template \"{label('changeset.{phase}', node|short)}\\n\""
+
+msgid "- Invert the firstline filter, i.e. everything but the first line::"
+msgstr "- firstline フィルタの逆(一行目以外)::"
+
+msgid "   $ hg log -r 0 --template \"{sub(r'^.*\\n?\\n?', '', desc)}\\n\"\n"
+msgstr "   $ hg log -r 0 --template \"{sub(r'^.*\\n?\\n?', '', desc)}\\n\"\n"
 
 msgid "Valid URLs are of the form::"
 msgstr "有効な URL 指定は以下の形式です::"
@@ -21832,6 +22042,10 @@
 msgstr ""
 
 #, python-format
+msgid "push includes divergent changeset: %s!"
+msgstr "履歴反映対象に分岐 (divergent) した後継リビジョンが含まれます!: %s"
+
+#, python-format
 msgid "updating %s to public failed!\n"
 msgstr "%s のフェーズの public 化に失敗!\n"
 
@@ -21870,6 +22084,9 @@
 msgid "received file revlog group is empty"
 msgstr "ファイルのリビジョンログが空です"
 
+msgid "received spurious file revlog entry"
+msgstr "ファイルのリビジョンログが不正な情報を含んでいます"
+
 #, python-format
 msgid "missing file data for %s:%s - run hg verify"
 msgstr "%s:%s のファイルデータが不在です - hg verify を実施してください"
@@ -21975,6 +22192,10 @@
 msgstr "差分コンテキストでの行数指定が不正です: %r"
 
 #, python-format
+msgid "warning: cannot merge flags for %s\n"
+msgstr "警告: ファイル %s の属性設定はマージできません\n"
+
+#, python-format
 msgid "%s: untracked file differs\n"
 msgstr "%s: 未登録ファイルに差分あり\n"
 
@@ -21986,23 +22207,6 @@
 msgid "case-folding collision between %s and %s"
 msgstr "ファイル名の文字大小の問題で %s と %s が衝突します"
 
-#, python-format
-msgid ""
-" conflicting flags for %s\n"
-"(n)one, e(x)ec or sym(l)ink?"
-msgstr ""
-"ファイル %s のビット設定に衝突があります\n"
-"どの設定にしますか? 無効:(n)one 実行可能:e(x)ec リンク:sym(l)ink"
-
-msgid "&None"
-msgstr "&None"
-
-msgid "E&xec"
-msgstr "E&xec"
-
-msgid "Sym&link"
-msgstr "Sym&link"
-
 msgid "resolving manifests\n"
 msgstr "管理ファイル一覧を解決しています\n"
 
@@ -22306,15 +22510,16 @@
 msgstr "%x は互換性のないリビジョンフラグです"
 
 #, python-format
+msgid "integrity check failed on %s:%d"
+msgstr "%s:%d の一貫性チェックに失敗"
+
+#, python-format
 msgid "%s not found in the transaction"
 msgstr "トランザクション中に %s は見つかりませんでした"
 
 msgid "consistency error in delta"
 msgstr "差分情報の不整合"
 
-msgid "unknown delta base"
-msgstr "未知の差分ベース"
-
 #, python-format
 msgid "can't use %s here"
 msgstr "ここでは %s を使用できません"
@@ -22459,6 +22664,19 @@
 msgstr "bumped には引数が指定できません"
 
 msgid ""
+"``bundle()``\n"
+"    Changesets in the bundle."
+msgstr ""
+"``bundle()``\n"
+"    バンドルファイル中のリビジョン群。"
+
+msgid "    Bundle must be specified by the -R option."
+msgstr "    バンドルファイルは -R オプションで指定される必要があります。"
+
+msgid "no bundle provided - specify with -R"
+msgstr "バンドルファイルが指定されていません。-R を使って指定してください。"
+
+msgid ""
 "``children(set)``\n"
 "    Child changesets of changesets in set."
 msgstr ""
@@ -22550,6 +22768,18 @@
 "    指定相当とみなします。"
 
 msgid ""
+"``divergent()``\n"
+"    Final successors of changesets with an alternative set of final "
+"successors."
+msgstr ""
+"``divergent()``\n"
+"    他の最終後継リビジョンが存在する、 最終後継リビジョン群。"
+
+#. i18n: "divergent" is a keyword
+msgid "divergent takes no arguments"
+msgstr "divergent には引数が指定できません"
+
+msgid ""
 "``draft()``\n"
 "    Changeset in draft phase."
 msgstr ""
@@ -22818,7 +23048,7 @@
 "    Changesets with more than one child."
 msgstr ""
 "``branchpoint()``\n"
-"    子リビジョンを1つ以上持つリビジョン群。"
+"    子リビジョンを2つ以上持つリビジョン群。"
 
 #. i18n: "branchpoint" is a keyword
 msgid "branchpoint takes no arguments"
@@ -23244,6 +23474,10 @@
 msgid "could not symlink to %r: %s"
 msgstr "%r に対してシンボリックリンクできません: %s"
 
+#, python-format
+msgid "%s not under root '%s'"
+msgstr "%s はルートディレクトリ '%s' の配下にはありません"
+
 msgid "empty revision range"
 msgstr "リビジョンの範囲指定が空です"
 
@@ -23398,6 +23632,10 @@
 msgstr "ファイル名キャッシュに不正なエントリ: %s 行目"
 
 #, python-format
+msgid "(in subrepo %s)"
+msgstr "(サブリポジトリ %s で発生)"
+
+#, python-format
 msgid "warning: subrepo spec file %s not found\n"
 msgstr "警告: サブリポジトリの spec ファイル %s が見つかりません\n"
 
@@ -23459,9 +23697,8 @@
 " サブリポジトリ %s のリビジョンに差分が検出されました\n"
 "どちらを採用しますか? 手元(%s):(l)ocal 連携先(%s):(r)emote\n"
 
-#, python-format
-msgid "default path for subrepository %s not found"
-msgstr "サブリポジトリ %s の が見つかりません"
+msgid "default path for subrepository not found"
+msgstr "サブリポジトリの連携先が見つかりません"
 
 #, python-format
 msgid "unknown subrepo type %s"
@@ -23660,7 +23897,7 @@
 "    ※ 後述する rfc3339date フィルタの説明も参照してください。"
 
 msgid ":localdate: Date. Converts a date to local date."
-msgstr ":localdate: 日時情報。 ローカル日時で可読化します。"
+msgstr ":localdate: 日時情報。 日時情報をローカルタイムゾーンに変換します。"
 
 msgid ":nonempty: Any text. Returns '(none)' if the string is empty."
 msgstr ":nonempty: 文字列。 与えられた文字列が空の場合 '(none)'となります。"
@@ -23810,7 +24047,8 @@
 msgid ""
 ":bookmarks: List of strings. Any bookmarks associated with the\n"
 "    changeset."
-msgstr ":tags: 文字列列挙。 当該リビジョンに付与されたブックマークの一覧。"
+msgstr ""
+":bookmarks: 文字列列挙。 当該リビジョンに付与されたブックマークの一覧。"
 
 msgid ":children: List of strings. The children of the changeset."
 msgstr ":children: 文字列列挙。 リビジョンの子供。"
@@ -23819,7 +24057,7 @@
 msgstr ":date: 日時情報。 リビジョンが記録された日時。"
 
 msgid ":desc: String. The text of the changeset description."
-msgstr ":desc:      文字列。 リビジョンのコミットメッセージ。"
+msgstr ":desc:      文字列。 リビジョンのコミットログ。"
 
 msgid ""
 ":diffstat: String. Statistics of changes with the following format:\n"
--- a/i18n/pt_BR.po	Sat Jan 19 17:20:39 2013 -0600
+++ b/i18n/pt_BR.po	Fri Feb 01 15:48:33 2013 -0600
@@ -31,7 +31,7 @@
 msgstr ""
 "Project-Id-Version: Mercurial\n"
 "Report-Msgid-Bugs-To: <mercurial-devel@selenic.com>\n"
-"POT-Creation-Date: 2012-10-23 11:38-0200\n"
+"POT-Creation-Date: 2013-01-21 11:21-0200\n"
 "PO-Revision-Date: 2011-06-28 09:55+0200\n"
 "Last-Translator: Wagner Bruna <wbruna@yahoo.com>\n"
 "Language-Team: Brazilian Portuguese\n"
@@ -1564,6 +1564,10 @@
 msgid "ignoring unknown color/effect %r (configured in color.%s)\n"
 msgstr "ignorando cor/efeito desconhecido %r (configurado em color.%s)\n"
 
+#. i18n: "label" is a keyword
+msgid "label expects two arguments"
+msgstr "label exige dois argumentos"
+
 #. i18n: 'always', 'auto', and 'never' are keywords and should
 #. not be translated
 msgid "when to colorize (boolean, always, auto, or never)"
@@ -1948,22 +1952,31 @@
 "        ``{{mergefrombranch ([-\\w]+)}}``"
 
 msgid ""
-"    :hook.cvslog: Specify a Python function to be called at the end of\n"
+"    :convert.localtimezone: use local time (as determined by the TZ\n"
+"        environment variable) for changeset date/times. The default\n"
+"        is False (use UTC)."
+msgstr ""
+"    :convert.localtimezone: use o fuso horário local (determinado\n"
+"        pela variável de ambiente TZ) para horários e datas de\n"
+"        revisões. O padrão é False (usará UTC)."
+
+msgid ""
+"    :hooks.cvslog: Specify a Python function to be called at the end of\n"
 "        gathering the CVS log. The function is passed a list with the\n"
 "        log entries, and can modify the entries in-place, or add or\n"
 "        delete them."
 msgstr ""
-"    :hook.cvslog: Especifica uma função Python a ser chamada ao término\n"
+"    :hooks.cvslog: Especifica uma função Python a ser chamada ao término\n"
 "        da coleta do log do CVS. Essa função recebe uma lista com as\n"
 "        entradas do log, e pode modificar, adicionar ou remover entradas."
 
 msgid ""
-"    :hook.cvschangesets: Specify a Python function to be called after\n"
+"    :hooks.cvschangesets: Specify a Python function to be called after\n"
 "        the changesets are calculated from the CVS log. The\n"
 "        function is passed a list with the changeset entries, and can\n"
 "        modify the changesets in-place, or add or delete them."
 msgstr ""
-"    :hook.cvschangesets: Especifica uma função Python a ser chamada\n"
+"    :hooks.cvschangesets: Especifica uma função Python a ser chamada\n"
 "        após os conjuntos de mudanças serem calculados a partir do\n"
 "        log do CVS. Essa função recebe uma lista com as entradas do\n"
 "        conjunto de mudanças, e pode modificar, adicionar ou\n"
@@ -2415,6 +2428,9 @@
 msgid "reading cvs log cache %s\n"
 msgstr "lendo cache de log do CVS %s\n"
 
+msgid "ignoring old cache\n"
+msgstr "ignorando cache antigo\n"
+
 #, python-format
 msgid "cache has %d log entries\n"
 msgstr "cache possui %d entradas de log\n"
@@ -2525,6 +2541,10 @@
 msgstr "não é possível ler objeto %r em %s"
 
 #, python-format
+msgid "cannot read submodules config file in %s"
+msgstr "não é possível ler arquivo de configuração de submódulos em %s"
+
+#, python-format
 msgid "cannot read changes in %s"
 msgstr "não é possível ler mudanças em %s"
 
@@ -3540,9 +3560,6 @@
 msgid "do not display revision or any of its ancestors"
 msgstr "não exibe revisão ou qualquer de seus ancestrais"
 
-msgid "show hidden changesets (DEPRECATED)"
-msgstr "exibe revisões ocultas (OBSOLETO)"
-
 msgid "[OPTION]... [FILE]"
 msgstr "[OPÇÃO]... [ARQUIVO]"
 
@@ -3880,7 +3897,7 @@
 " pick 7c2fd3b9020c Add delta"
 
 msgid ""
-" # Edit history between 633536316234 and 7c2fd3b9020c\n"
+" # Edit history between c561b4e977df and 7c2fd3b9020c\n"
 " #\n"
 " # Commands:\n"
 " #  p, pick = use commit\n"
@@ -3890,7 +3907,7 @@
 " #  m, mess = edit message without changing commit content\n"
 " #"
 msgstr ""
-" # Editar o histórico entre 633536316234 e 7c2fd3b9020c\n"
+" # Editar o histórico entre c561b4e977df e 7c2fd3b9020c\n"
 " #\n"
 " # Comandos:\n"
 " #  p, pick = use a revisão\n"
@@ -4037,11 +4054,11 @@
 "à tentativa de edição de histórico."
 
 msgid ""
-"If we clone the example repository above and add three more changes, such that\n"
-"we have the following history::"
+"If we clone the histedit-ed example repository above and add four more\n"
+"changes, such that we have the following history::"
 msgstr ""
 "Se clonarmos o repositório de exemplo acima e adicionarmos mais\n"
-"três mudanças, de modo que tenhamos o seguinte histórico::"
+"quatro mudanças, de modo que tenhamos o seguinte histórico::"
 
 msgid ""
 "   @  6[tip]   038383181893   2009-04-27 18:04 -0500   stefan\n"
@@ -4390,13 +4407,6 @@
 msgid "cannot start: socket is already bound"
 msgstr "não é possível iniciar: o socket já está associado"
 
-msgid ""
-"cannot start: tried linking .hg/inotify.sock to a temporary socket but "
-".hg/inotify.sock already exists"
-msgstr ""
-"não é possível iniciar: tentou lincar .hg/inotify.sock para um socket "
-"temporário mas .hg/inotify.sock já existe"
-
 #, python-format
 msgid "answering query for %r\n"
 msgstr "respondendo consulta para %r\n"
@@ -4993,6 +5003,10 @@
 "    normais; após essa conversão, o repositório DEST poderá ser\n"
 "    usado normalmente, sem a extensão largefiles."
 
+#, python-format
+msgid "error getting id %s from url %s for file %s: %s\n"
+msgstr "erro ao obter id %s a partir da url %s para o arquivo %s: %s\n"
+
 msgid "getting largefiles"
 msgstr "obtendo largefiles"
 
@@ -5148,17 +5162,19 @@
 msgstr "nenhum arquivo especificado"
 
 #, python-format
-msgid "not removing %s: %s (use forget to undo)\n"
-msgstr "%s não removido: %s (use forget para desfazer)\n"
-
-msgid "file still exists"
-msgstr "o arquivo já existe"
-
-msgid "file is modified"
-msgstr "o arquivo foi modificado"
-
-msgid "file has been marked for add"
-msgstr "o arquivo foi marcado para adição"
+msgid "not removing %s: file still exists\n"
+msgstr "arquivo %s não removido: o arquivo ainda existe\n"
+
+#, python-format
+msgid "not removing %s: file is modified (use -f to force removal)\n"
+msgstr ""
+"%s não removido: o arquivo foi modificado (use -f para forçar a remoção)\n"
+
+#, python-format
+msgid "not removing %s: file has been marked for add (use forget to undo)\n"
+msgstr ""
+"%s não removido: o arquivo foi marcado para adição (use forget para "
+"desfazer)\n"
 
 #, python-format
 msgid "removing %s\n"
@@ -5358,6 +5374,9 @@
 msgid "verify largefile contents not just existence"
 msgstr "verifica conteúdos de largefiles, não apenas existência"
 
+msgid "display largefiles dirstate"
+msgstr "mostra o dirstate de largefiles"
+
 msgid "display outgoing largefiles"
 msgstr "exibe largefiles a serem enviados"
 
@@ -8141,6 +8160,13 @@
 "    repositórios, que aparecerão como duplicatas das revisões rebaseadas."
 
 msgid ""
+"    In its default configuration, Mercurial will prevent you from\n"
+"    rebasing published changes. See :hg:`help phases` for details."
+msgstr ""
+"    Em sua configuração padrão, o Mercurial impede que revisões\n"
+"    públicas sejam rebaseadas. Veja :hg:`help phases` para mais detalhes."
+
+msgid ""
 "    If you don't specify a destination changeset (``-d/--dest``),\n"
 "    rebase uses the tipmost head of the current named branch as the\n"
 "    destination. (The destination changeset is not modified by\n"
@@ -8179,6 +8205,18 @@
 "    como revisão base."
 
 msgid ""
+"    For advanced usage, a third way is available through the ``--rev``\n"
+"    option. It allows you to specify an arbitrary set of changesets to\n"
+"    rebase. Descendants of revs you specify with this option are not\n"
+"    automatically included in the rebase."
+msgstr ""
+"    Um modo avançado adicional está disponível através da opção\n"
+"    ``--rev``. Ele possibilita a especificação de um conjunto\n"
+"    arbitrário de revisões a serem rebaseadas. Os descendentes\n"
+"    das revisões especificadas dessa maneira não serão\n"
+"    automaticamente incluídos no rebaseamento."
+
+msgid ""
 "    By default, rebase recreates the changesets in the source branch\n"
 "    as descendants of dest and then destroys the originals. Use\n"
 "    ``--keep`` to preserve the original source changesets. Some\n"
@@ -8321,9 +8359,6 @@
 msgid "no matching revisions"
 msgstr "nenhuma revisão correspondente"
 
-msgid "can't rebase multiple roots"
-msgstr "não é possível rebasear múltiplas raízes"
-
 msgid "source is ancestor of destination"
 msgstr "origem é ancestral do destino"
 
@@ -9327,9 +9362,8 @@
 msgid "unknown parent"
 msgstr "pai desconhecido"
 
-#, python-format
-msgid "integrity check failed on %s:%d"
-msgstr "checagem de integridade falhou em %s:%d"
+msgid "unknown delta base"
+msgstr "base de delta desconhecida"
 
 msgid "cannot create new bundle repository"
 msgstr "não é possível criar novo repositório de bundle"
@@ -9720,6 +9754,9 @@
 msgid "display help and exit"
 msgstr "exibe ajuda e sai"
 
+msgid "consider hidden changesets"
+msgstr "considera revisões ocultas"
+
 msgid "do not perform actions, just print output"
 msgstr "não realiza ações, apenas imprime a saída"
 
@@ -10280,6 +10317,15 @@
 "          hg bisect --skip\n"
 "          hg bisect --skip 23"
 
+msgid ""
+"      - skip all revisions that do not touch directories ``foo`` or ``bar``"
+msgstr ""
+"      - omite todas as revisões que não mexerem nos diretórios ``foo`` ou "
+"``bar``"
+
+msgid "          hg bisect --skip '!( file(\"path:foo\") & file(\"path:bar\") )'"
+msgstr "          hg bisect --skip '!( file(\"path:foo\") & file(\"path:bar\") )'"
+
 msgid "      - forget the current bisection::"
 msgstr "      - esquece a bissecção atual::"
 
@@ -10465,6 +10511,15 @@
 "    "
 
 msgid ""
+"    If you set a bookmark called '@', new clones of the repository will\n"
+"    have that revision checked out (and the bookmark made active) by\n"
+"    default."
+msgstr ""
+"    Se você definir um marcador chamado '@', novos clones do\n"
+"    repositório por padrão atualizarão para essa revisão e\n"
+"    tornarão esse marcador ativo."
+
+msgid ""
 "    With -i/--inactive, the new bookmark will not be made the active\n"
 "    bookmark. If -r/--rev is given, the new bookmark will not be made\n"
 "    active even if -i/--inactive is not given. If no NAME is given, the\n"
@@ -10827,6 +10882,14 @@
 "    etiquetada mas não incluirá a revisão que define a etiqueta em si."
 
 msgid ""
+"    If the source repository has a bookmark called '@' set, that\n"
+"    revision will be checked out in the new repository by default."
+msgstr ""
+"    Se o repositório de origem possuir um marcador de nome '@'\n"
+"    definido, por padrão o novo repositório será atualizado para\n"
+"    essa revisão."
+
+msgid ""
 "    To check out a particular version, use -u/--update, or\n"
 "    -U/--noupdate to create a clone with no working directory."
 msgstr ""
@@ -10891,8 +10954,9 @@
 "      d) the changeset specified with -r\n"
 "      e) the tipmost head specified with -b\n"
 "      f) the tipmost head specified with the url#branch source syntax\n"
-"      g) the tipmost head of the default branch\n"
-"      h) tip"
+"      g) the revision marked with the '@' bookmark, if present\n"
+"      h) the tipmost head of the default branch\n"
+"      i) tip"
 msgstr ""
 "      a) null, se for passada a opção -U ou se o repositório de origem não\n"
 "         tiver revisões\n"
@@ -10904,8 +10968,9 @@
 "      e) a cabeça mais recente especificada com -b\n"
 "      f) a cabeça mais recente especificada com a sintaxe de origem\n"
 "         url#ramo\n"
-"      g) a cabeça mais recente do ramo default\n"
-"      h) a tip"
+"      g) a revisão apontada pelo marcador '@', se presente\n"
+"      h) a cabeça mais recente do ramo default\n"
+"      i) a tip"
 
 msgid "      - clone a remote repository to a new directory named hg/::"
 msgstr ""
@@ -11600,6 +11665,77 @@
 msgid "revision to check"
 msgstr "revisão para verificar"
 
+msgid "[REV]"
+msgstr "[REV]"
+
+msgid "show set of successors for revision"
+msgstr "mostra conjunto de sucessores da revisão"
+
+msgid ""
+"    A successors set of changeset A is a consistent group of revisions that\n"
+"    succeed A. It contains non-obsolete changesets only."
+msgstr ""
+"    Um conjunto de sucessores de uma revisão A é um grupo consistente de\n"
+"    revisões que sucedem A. Pode conter apenas revisões não obsoletas."
+
+msgid ""
+"    In most cases a changeset A has a single successors set containing a single\n"
+"    successor (changeset A replaced by A')."
+msgstr ""
+"    Na maior parte dos casos uma revisão A possui um único conjunto\n"
+"    de sucessores contendo um único sucessor (revisão A substituída por A')."
+
+msgid ""
+"    A changeset that is made obsolete with no successors are called \"pruned\".\n"
+"    Such changesets have no successors sets at all."
+msgstr ""
+"    Uma revisão sem sucessores tornada obsoleta é chamada \"podada\".\n"
+"    Tais revisões não possuem nenhum conjunto de sucessores."
+
+msgid ""
+"    A changeset that has been \"split\" will have a successors set containing\n"
+"    more than one successor."
+msgstr ""
+"    Uma revisão que tenha sido \"dividida\" terá um conjunto de\n"
+"    sucessores contendo mais de um sucessor."
+
+msgid ""
+"    A changeset that has been rewritten in multiple different ways is called\n"
+"    \"divergent\". Such changesets have multiple successor sets (each of which\n"
+"    may also be split, i.e. have multiple successors)."
+msgstr ""
+"    Uma revisão que tenha sido reescrita de múltiplas formas diferentes\n"
+"    é chamada \"divergente\". Tais revisões possuem múltiplos conjuntos\n"
+"    de sucessores (cada um dos quais pode também ser dividido, isto é,\n"
+"    ter múltiplos sucessores)."
+
+msgid "    Results are displayed as follows::"
+msgstr "    Os resultados são mostrados da seguinte maneira::"
+
+msgid ""
+"        <rev1>\n"
+"            <successors-1A>\n"
+"        <rev2>\n"
+"            <successors-2A>\n"
+"            <successors-2B1> <successors-2B2> <successors-2B3>"
+msgstr ""
+"        <rev1>\n"
+"            <sucessores-1A>\n"
+"        <rev2>\n"
+"            <sucessores-2A>\n"
+"            <sucessores-2B1> <sucessores-2B2> <sucessores-2B3>"
+
+msgid ""
+"    Here rev2 has two possible (i.e. divergent) successors sets. The first\n"
+"    holds one element, whereas the second holds three (i.e. the changeset has\n"
+"    been split).\n"
+"    "
+msgstr ""
+"    Aqui, rev2 possui dois (ou seja, divergentes) possíveis conjuntos\n"
+"    de sucessores. O primeiro possui um elemento, e o segundo possui\n"
+"    três (a revisão foi dividida).\n"
+"    "
+
 msgid "show how files match on given patterns"
 msgstr "mostra como os arquivos casam com os padrões pedidos"
 
@@ -13497,22 +13633,6 @@
 msgid "not removing %s: file is untracked\n"
 msgstr "arquivo %s não removido: arquivo não rastreado\n"
 
-#, python-format
-msgid "not removing %s: file still exists (use -f to force removal)\n"
-msgstr ""
-"%s não removido: o arquivo ainda existe (use -f para forçar a remoção)\n"
-
-#, python-format
-msgid "not removing %s: file is modified (use -f to force removal)\n"
-msgstr ""
-"%s não removido: o arquivo foi modificado (use -f para forçar a remoção)\n"
-
-#, python-format
-msgid "not removing %s: file has been marked for add (use forget to undo)\n"
-msgstr ""
-"%s não removido: o arquivo foi marcado para adição (use forget para "
-"desfazer)\n"
-
 msgid "record a rename that has already occurred"
 msgstr "grava uma renomeação que já ocorreu"
 
@@ -14533,6 +14653,10 @@
 "    Se você quiser reverter apenas um arquivo para seu conteúdo em\n"
 "    uma revisão anterior, use :hg:`revert [-r REV] NOME`."
 
+#, python-format
+msgid "updating to active bookmark %s\n"
+msgstr "atualizando para o marcador ativo %s\n"
+
 msgid "cannot specify both -c/--check and -C/--clean"
 msgstr "não se pode especificar ao mesmo tempo -c/--check e -C/--clean"
 
@@ -14594,13 +14718,13 @@
 msgstr "não é possível incluir %s (%s)"
 
 #, python-format
+msgid "unknown revision '%s'"
+msgstr "revisão desconhecida '%s'"
+
+#, python-format
 msgid "working directory has unknown parent '%s'!"
 msgstr "diretório de trabalho tem pai desconhecido '%s'!"
 
-#, python-format
-msgid "unknown revision '%s'"
-msgstr "revisão desconhecida '%s'"
-
 msgid "not found in manifest"
 msgstr "não encontrado no manifesto"
 
@@ -14820,6 +14944,10 @@
 msgid "broken pipe\n"
 msgstr "pipe quebrado\n"
 
+#, python-format
+msgid "abort: %s: '%s'\n"
+msgstr "abortado: %s: '%s'\n"
+
 msgid "interrupted!\n"
 msgstr "interrompido!\n"
 
@@ -15048,6 +15176,10 @@
 "a mesclagem de %s está incompleta! (edite os conflitos, e em seguida use 'hg"
 " resolve --mark')\n"
 
+#, python-format
+msgid "warning: internal:merge cannot merge symlinks for %s\n"
+msgstr "aviso: internal:merge não é capaz de mesclar links simbólicos para %s\n"
+
 msgid ""
 "``internal:dump``\n"
 "Creates three versions of the files to merge, containing the\n"
@@ -17316,24 +17448,6 @@
 "    Sempre perguntar se a mesclagem teve sucesso, sem levar em conta o informado pela ferramenta."
 
 msgid ""
-"``checkchanged``\n"
-"  True is equivalent to ``check = changed``.\n"
-"  Default: False"
-msgstr ""
-"``checkchanged``\n"
-"  True equivale a ``check = changed``.\n"
-"  Padrão: False"
-
-msgid ""
-"``checkconflicts``\n"
-"  True is equivalent to ``check = conflicts``.\n"
-"  Default: False"
-msgstr ""
-"``checkconflicts``\n"
-"  True equivale a ``check = conflicts``.\n"
-"  Padrão: False"
-
-msgid ""
 "``fixeol``\n"
 "  Attempt to fix up EOL changes caused by the merge tool.\n"
 "  Default: False"
@@ -17649,6 +17763,34 @@
 "    são impressos na saída de erros."
 
 msgid ""
+"``sort``\n"
+"    Sort field.  Specific to the ``ls`` instrumenting profiler.\n"
+"    One of ``callcount``, ``reccallcount``, ``totaltime`` and\n"
+"    ``inlinetime``.\n"
+"    Default: inlinetime."
+msgstr ""
+"``sort``\n"
+"    Campo de ordenação.  Específico para o profiler de instrumentação.\n"
+"    Pode ter os valores ``callcount``, ``reccallcount``, ``totaltime``\n"
+"    e ``inlinetime``.\n"
+"    Padrão: inlinetime."
+
+msgid ""
+"``nested``\n"
+"    Show at most this number of lines of drill-down info in a tree structure\n"
+"    after each main entry. This can help explain the difference between Total\n"
+"    and Inline.\n"
+"    Specific to the ``ls`` instrumenting profiler.\n"
+"    Default: 5."
+msgstr ""
+"``nested``\n"
+"    Mostra no máximo este número de linhas de informações em uma\n"
+"    estrutura de árvore após cada entrada principal. Isto pode\n"
+"    ajudar a explicar a diferença entre Total e Inline.\n"
+"    Específico do profiler de instrumentação ``ls``.\n"
+"    Padrão: 5."
+
+msgid ""
 "``revsetalias``\n"
 "---------------"
 msgstr ""
@@ -18321,6 +18463,15 @@
 "    O padrão é False."
 
 msgid ""
+"``archivesubrepos``\n"
+"    Whether to recurse into subrepositories when archiving. Default is\n"
+"    False."
+msgstr ""
+"``archivesubrepos``\n"
+"    Determina se sub-repositórios devem ser percorridos recursivamente\n"
+"    em uma operação archive. O padrão é False."
+
+msgid ""
 "``baseurl``\n"
 "    Base URL to use when publishing URLs in other locations, so\n"
 "    third-party tools like email notification hooks can construct\n"
@@ -21341,10 +21492,10 @@
 
 msgid ""
 "    hg log -r \"(keyword(bug) or keyword(issue)) and not "
-"ancestors(tagged())\"\n"
+"ancestors(tag())\"\n"
 msgstr ""
 "    hg log -r \"(keyword(bug) or keyword(issue)) and not "
-"ancestors(tagged())\"\n"
+"ancestors(tag())\"\n"
 
 msgid ""
 "Subrepositories let you nest external repositories or projects into a\n"
@@ -21768,8 +21919,103 @@
 msgid "List of filters:"
 msgstr "Lista de filtros:"
 
-msgid ".. filtersmarker\n"
-msgstr ".. filtersmarker\n"
+msgid ".. filtersmarker"
+msgstr ".. filtersmarker"
+
+msgid ""
+"Note that a filter is nothing more than a function call, i.e.\n"
+"``expr|filter`` is equivalent to ``filter(expr)``."
+msgstr ""
+"Note que um filtro é apenas uma chamada de função, ou seja,\n"
+"``expr|filtro`` é equivalente a ``filtro(expr)``."
+
+msgid "In addition to filters, there are some basic built-in functions:"
+msgstr "Além de filtros, há algumas funções básicas disponíveis:"
+
+msgid "- if(expr, then[, else])"
+msgstr "- if(expr, então[, senão])"
+
+msgid "- ifeq(expr, expr, then[, else])"
+msgstr "- ifeq(expr, expr, então[, senão])"
+
+msgid "- sub(pat, repl, expr)"
+msgstr "- sub(padrão, substituição, expr)"
+
+msgid "- join(list, sep)"
+msgstr "- join(lista, separador)"
+
+msgid "- label(label, expr)"
+msgstr "- label(label, expr)"
+
+msgid "- date(date[, fmt])"
+msgstr "- date(data[, formato])"
+
+msgid "- fill(text[, width])"
+msgstr "- fill(texto[, comprimento])"
+
+msgid ""
+"Also, for any expression that returns a list, there is a list operator:"
+msgstr ""
+"Além disso, para cada expressão que devolve uma lista, há um\n"
+"operador de lista:"
+
+msgid "- expr % \"{template}\""
+msgstr "- expr % \"{modelo}\""
+
+msgid "Some sample command line templates:"
+msgstr "Alguns exemplos de modelos de linha de comando:"
+
+msgid "- Format lists, e.g. files::"
+msgstr "- Formatação de listas, por exemplo arquivos::"
+
+msgid "   $ hg log -r 0 --template \"files:\\n{files % '  {file}\\n'}\""
+msgstr "   $ hg log -r 0 --template \"files:\\n{files % '  {file}\\n'}\""
+
+msgid "- Join the list of files with a \", \"::"
+msgstr "- Juntar a lista de arquivos com \", \"::"
+
+msgid "   $ hg log -r 0 --template \"files: {join(files, ', ')}\\n\""
+msgstr "   $ hg log -r 0 --template \"files: {join(files, ', ')}\\n\""
+
+msgid "- Format date::"
+msgstr "- Formatação de datas::"
+
+msgid "   $ hg log -r 0 --template \"{date(date, '%Y')}\\n\""
+msgstr "   $ hg log -r 0 --template \"{date(date, '%Y')}\\n\""
+
+msgid "- Output the description set to a fill-width of 30::"
+msgstr "- Informar as descrições em um campo de largura 30::"
+
+msgid "   $ hg log -r 0 --template \"{fill(desc, '30')}\""
+msgstr "   $ hg log -r 0 --template \"{fill(desc, '30')}\""
+
+msgid "- Use a conditional to test for the default branch::"
+msgstr "- Usar uma conditional para testar pelo ramo default::"
+
+msgid ""
+"   $ hg log -r 0 --template \"{ifeq(branch, 'default', 'on the main branch',\n"
+"   'on branch {branch}')}\\n\""
+msgstr ""
+"   $ hg log -r 0 --template \"{ifeq(branch, 'default', 'on the main branch',\n"
+"   'on branch {branch}')}\\n\""
+
+msgid "- Append a newline if not empty::"
+msgstr "- Anexar uma quebra de linha se não for vazio::"
+
+msgid "   $ hg tip --template \"{if(author, '{author}\\n')}\""
+msgstr "   $ hg tip --template \"{if(author, '{author}\\n')}\""
+
+msgid "- Label the output for use with the color extension::"
+msgstr "- Rotular a saída para uso da extensão color::"
+
+msgid "   $ hg log -r 0 --template \"{label('changeset.{phase}', node|short)}\\n\""
+msgstr "   $ hg log -r 0 --template \"{label('changeset.{phase}', node|short)}\\n\""
+
+msgid "- Invert the firstline filter, i.e. everything but the first line::"
+msgstr "- Inverter o filtro firstline, ou seja, tudo menos a primeira linha::"
+
+msgid "   $ hg log -r 0 --template \"{sub(r'^.*\\n?\\n?', '', desc)}\\n\"\n"
+msgstr "   $ hg log -r 0 --template \"{sub(r'^.*\\n?\\n?', '', desc)}\\n\"\n"
 
 msgid "Valid URLs are of the form::"
 msgstr "URLs válidas são da forma::"
@@ -22306,6 +22552,10 @@
 msgstr "push inclui revisão colidida: %s!"
 
 #, python-format
+msgid "push includes divergent changeset: %s!"
+msgstr "push inclui uma revisão divergente: %s!"
+
+#, python-format
 msgid "updating %s to public failed!\n"
 msgstr "a atualização da fase de %s para pública falhou!\n"
 
@@ -22344,6 +22594,9 @@
 msgid "received file revlog group is empty"
 msgstr "grupo recebido de arquivos revlog vazio"
 
+msgid "received spurious file revlog entry"
+msgstr "recebida entrada de revlog de arquivo espúria"
+
 #, python-format
 msgid "missing file data for %s:%s - run hg verify"
 msgstr "faltando dados de arquivo para %s:%s - execute hg verify"
@@ -22452,6 +22705,10 @@
 msgstr "o número de linhas de contexto de diff deve ser um inteiro, e não %r"
 
 #, python-format
+msgid "warning: cannot merge flags for %s\n"
+msgstr "aviso: não é possível mesclar flags para %s\n"
+
+#, python-format
 msgid "%s: untracked file differs\n"
 msgstr "%s: arquivo não rastreado é diferente\n"
 
@@ -22465,23 +22722,6 @@
 msgid "case-folding collision between %s and %s"
 msgstr "conflito de maiúsculas e minúsculas entre %s e %s"
 
-#, python-format
-msgid ""
-" conflicting flags for %s\n"
-"(n)one, e(x)ec or sym(l)ink?"
-msgstr ""
-" modo conflitante para %s\n"
-"(n)enhum, e(x)ecutável ou (l)ink simbólico?"
-
-msgid "&None"
-msgstr "&Nenhum"
-
-msgid "E&xec"
-msgstr "E&xecutável"
-
-msgid "Sym&link"
-msgstr "&Link simbólico"
-
 msgid "resolving manifests\n"
 msgstr "examinando manifestos\n"
 
@@ -22793,15 +23033,16 @@
 msgstr "marcação de revisão incompatível %x"
 
 #, python-format
+msgid "integrity check failed on %s:%d"
+msgstr "checagem de integridade falhou em %s:%d"
+
+#, python-format
 msgid "%s not found in the transaction"
 msgstr "%s não encontrado na transação"
 
 msgid "consistency error in delta"
 msgstr "erro de consistência no delta"
 
-msgid "unknown delta base"
-msgstr "base de delta desconhecida"
-
 #, python-format
 msgid "can't use %s here"
 msgstr "não se pode usar %s aqui"
@@ -22943,6 +23184,19 @@
 msgstr "bumped não tem argumentos"
 
 msgid ""
+"``bundle()``\n"
+"    Changesets in the bundle."
+msgstr ""
+"``bundle()``\n"
+"    Revisões no bundle."
+
+msgid "    Bundle must be specified by the -R option."
+msgstr "    Um bundle deve ser especificado pela opção -R."
+
+msgid "no bundle provided - specify with -R"
+msgstr "nenhum bundle fornecido - especifique com -R"
+
+msgid ""
 "``children(set)``\n"
 "    Child changesets of changesets in set."
 msgstr ""
@@ -23033,6 +23287,18 @@
 "    não for especificado, será o mesmo que especificar all()."
 
 msgid ""
+"``divergent()``\n"
+"    Final successors of changesets with an alternative set of final successors."
+msgstr ""
+"``divergent()``\n"
+"    Sucessores finais de revisões com um conjunto alternativo de\n"
+"    sucessores finais."
+
+#. i18n: "divergent" is a keyword
+msgid "divergent takes no arguments"
+msgstr "divergent não tem argumentos"
+
+msgid ""
 "``draft()``\n"
 "    Changeset in draft phase."
 msgstr ""
@@ -23730,6 +23996,10 @@
 msgid "could not symlink to %r: %s"
 msgstr "impossível criar link simbólico para %r: %s"
 
+#, python-format
+msgid "%s not under root '%s'"
+msgstr "%s não está sob a raiz '%s'"
+
 msgid "empty revision range"
 msgstr "faixa de revisões vazia"
 
@@ -23892,6 +24162,10 @@
 msgstr "entrada inválida na fncache, linha %s"
 
 #, python-format
+msgid "(in subrepo %s)"
+msgstr "(no sub-repositório %s)"
+
+#, python-format
 msgid "warning: subrepo spec file %s not found\n"
 msgstr "aviso: arquivo spec de sub-repositório %s não encontrado\n"
 
@@ -23955,9 +24229,8 @@
 " as origens do sub-repositório %s diferem (na versão do diretório de trabalho)\n"
 "usar origem (l)ocal (%s) ou (r)emota (%s)?\n"
 
-#, python-format
-msgid "default path for subrepository %s not found"
-msgstr "o caminho padrão para o sub-repositório %s não foi encontrado"
+msgid "default path for subrepository not found"
+msgstr "o caminho padrão para o sub-repositório não foi encontrado"
 
 #, python-format
 msgid "unknown subrepo type %s"
--- a/mercurial/bookmarks.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/bookmarks.py	Fri Feb 01 15:48:33 2013 -0600
@@ -134,6 +134,19 @@
     finally:
         wlock.release()
 
+def iscurrent(repo, mark=None, parents=None):
+    '''Tell whether the current bookmark is also active
+
+    I.e., the bookmark listed in .hg/bookmarks.current also points to a
+    parent of the working directory.
+    '''
+    if not mark:
+        mark = repo._bookmarkcurrent
+    if not parents:
+        parents = [p.node() for p in repo[None].parents()]
+    marks = repo._bookmarks
+    return (mark in marks and marks[mark] in parents)
+
 def updatecurrentbookmark(repo, oldnode, curbranch):
     try:
         return update(repo, oldnode, repo.branchtip(curbranch))
@@ -143,6 +156,20 @@
         else:
             raise util.Abort(_("branch %s not found") % curbranch)
 
+def deletedivergent(repo, deletefrom, bm):
+    '''Delete divergent versions of bm on nodes in deletefrom.
+
+    Return True if at least one bookmark was deleted, False otherwise.'''
+    deleted = False
+    marks = repo._bookmarks
+    divergent = [b for b in marks if b.split('@', 1)[0] == bm.split('@', 1)[0]]
+    for mark in divergent:
+        if mark and marks[mark] in deletefrom:
+            if mark != bm:
+                del marks[mark]
+                deleted = True
+    return deleted
+
 def update(repo, parents, node):
     marks = repo._bookmarks
     update = False
@@ -150,16 +177,16 @@
     if not cur:
         return False
 
-    toupdate = [b for b in marks if b.split('@', 1)[0] == cur.split('@', 1)[0]]
-    for mark in toupdate:
-        if mark and marks[mark] in parents:
-            old = repo[marks[mark]]
-            new = repo[node]
-            if old.descendant(new) and mark == cur:
-                marks[cur] = new.node()
-                update = True
-            if mark != cur:
-                del marks[mark]
+    if marks[cur] in parents:
+        old = repo[marks[cur]]
+        new = repo[node]
+        if old.descendant(new):
+            marks[cur] = new.node()
+            update = True
+
+    if deletedivergent(repo, parents, cur):
+        update = True
+
     if update:
         marks.write()
     return update
@@ -170,9 +197,10 @@
     marks = getattr(repo, '_bookmarks', {})
 
     d = {}
+    hasnode = repo.changelog.hasnode
     for k, v in marks.iteritems():
         # don't expose local divergent bookmarks
-        if '@' not in k or k.endswith('@'):
+        if hasnode(v) and ('@' not in k or k.endswith('@')):
             d[k] = hex(v)
     return d
 
--- a/mercurial/commands.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/commands.py	Fri Feb 01 15:48:33 2013 -0600
@@ -785,6 +785,10 @@
     repositories to support bookmarks. For versions prior to 1.8, this means
     the bookmarks extension must be enabled.
 
+    If you set a bookmark called '@', new clones of the repository will
+    have that revision checked out (and the bookmark made active) by
+    default.
+
     With -i/--inactive, the new bookmark will not be made the active
     bookmark. If -r/--rev is given, the new bookmark will not be made
     active even if -i/--inactive is not given. If no NAME is given, the
@@ -869,7 +873,7 @@
     else: # show bookmarks
         for bmark, n in sorted(marks.iteritems()):
             current = repo._bookmarkcurrent
-            if bmark == current and n == cur:
+            if bmark == current:
                 prefix, label = '*', 'bookmarks.current'
             else:
                 prefix, label = ' ', ''
@@ -1146,6 +1150,9 @@
     tag will include the tagged changeset but not the changeset
     containing the tag.
 
+    If the source repository has a bookmark called '@' set, that
+    revision will be checked out in the new repository by default.
+
     To check out a particular version, use -u/--update, or
     -U/--noupdate to create a clone with no working directory.
 
@@ -1181,8 +1188,9 @@
       d) the changeset specified with -r
       e) the tipmost head specified with -b
       f) the tipmost head specified with the url#branch source syntax
-      g) the tipmost head of the default branch
-      h) tip
+      g) the revision marked with the '@' bookmark, if present
+      h) the tipmost head of the default branch
+      i) tip
 
       Examples:
 
@@ -2473,13 +2481,13 @@
     succeed A. It contains non-obsolete changesets only.
 
     In most cases a changeset A has a single successors set containing a single
-    successors (changeset A replaced by A').
+    successor (changeset A replaced by A').
 
     A changeset that is made obsolete with no successors are called "pruned".
     Such changesets have no successors sets at all.
 
     A changeset that has been "split" will have a successors set containing
-    more than one successors.
+    more than one successor.
 
     A changeset that has been rewritten in multiple different ways is called
     "divergent". Such changesets have multiple successor sets (each of which
@@ -5866,7 +5874,7 @@
     Returns 0 on success.
     """
     displayer = cmdutil.show_changeset(ui, repo, opts)
-    displayer.show(repo[len(repo) - 1])
+    displayer.show(repo['tip'])
     displayer.close()
 
 @command('unbundle',
@@ -5961,7 +5969,12 @@
     # with no argument, we also move the current bookmark, if any
     movemarkfrom = None
     if rev is None:
-        movemarkfrom = repo['.'].node()
+        curmark = repo._bookmarkcurrent
+        if bookmarks.iscurrent(repo):
+            movemarkfrom = repo['.'].node()
+        elif curmark:
+            ui.status(_("updating to active bookmark %s\n") % curmark)
+            rev = curmark
 
     # if we defined a bookmark, we have to remember the original bookmark name
     brev = rev
--- a/mercurial/context.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/context.py	Fri Feb 01 15:48:33 2013 -0600
@@ -44,8 +44,8 @@
             self._rev = nullrev
             return
         if changeid == 'tip':
-            self._rev = len(repo.changelog) - 1
-            self._node = repo.changelog.node(self._rev)
+            self._node = repo.changelog.tip()
+            self._rev = repo.changelog.rev(self._node)
             return
         if len(changeid) == 20:
             try:
--- a/mercurial/graphmod.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/graphmod.py	Fri Feb 01 15:48:33 2013 -0600
@@ -181,7 +181,7 @@
     ncols = len(seen)
     nextseen = seen[:]
     nextseen[nodeidx:nodeidx + 1] = newparents
-    edges = [(nodeidx, nextseen.index(p)) for p in knownparents]
+    edges = [(nodeidx, nextseen.index(p)) for p in knownparents if p != nullrev]
 
     while len(newparents) > 2:
         # ascii() only knows how to add or remove a single column between two
--- a/mercurial/hbisect.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/hbisect.py	Fri Feb 01 15:48:33 2013 -0600
@@ -38,7 +38,7 @@
         # set nodes descended from goodrevs
         for rev in goodrevs:
             ancestors[rev] = []
-        for rev in xrange(goodrev + 1, len(changelog)):
+        for rev in changelog.revs(goodrev + 1):
             for prev in clparents(rev):
                 if ancestors[prev] == []:
                     ancestors[rev] = []
@@ -46,7 +46,7 @@
         # clear good revs from array
         for rev in goodrevs:
             ancestors[rev] = None
-        for rev in xrange(len(changelog), goodrev, -1):
+        for rev in changelog.revs(len(changelog), goodrev):
             if ancestors[rev] is None:
                 for prev in clparents(rev):
                     ancestors[prev] = None
--- a/mercurial/help/config.txt	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/help/config.txt	Fri Feb 01 15:48:33 2013 -0600
@@ -990,6 +990,19 @@
     file exists, it is replaced. Default: None, data is printed on
     stderr
 
+``sort``
+    Sort field.  Specific to the ``ls`` instrumenting profiler.
+    One of ``callcount``, ``reccallcount``, ``totaltime`` and
+    ``inlinetime``.
+    Default: inlinetime.
+
+``nested``
+    Show at most this number of lines of drill-down info in a tree structure
+    after each main entry. This can help explain the difference between Total
+    and Inline.
+    Specific to the ``ls`` instrumenting profiler.
+    Default: 5.
+
 ``revsetalias``
 ---------------
 
--- a/mercurial/help/revsets.txt	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/help/revsets.txt	Fri Feb 01 15:48:33 2013 -0600
@@ -118,4 +118,4 @@
 - Changesets mentioning "bug" or "issue" that are not in a tagged
   release::
 
-    hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tagged())"
+    hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
--- a/mercurial/help/templates.txt	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/help/templates.txt	Fri Feb 01 15:48:33 2013 -0600
@@ -38,3 +38,61 @@
 List of filters:
 
 .. filtersmarker
+
+Note that a filter is nothing more than a function call, i.e.
+``expr|filter`` is equivalent to ``filter(expr)``.
+
+In addition to filters, there are some basic built-in functions:
+
+- if(expr, then[, else])
+
+- ifeq(expr, expr, then[, else])
+
+- sub(pat, repl, expr)
+
+- join(list, sep)
+
+- label(label, expr)
+
+- date(date[, fmt])
+
+- fill(text[, width])
+
+Also, for any expression that returns a list, there is a list operator:
+
+- expr % "{template}"
+
+Some sample command line templates:
+
+- Format lists, e.g. files::
+
+   $ hg log -r 0 --template "files:\n{files % '  {file}\n'}"
+
+- Join the list of files with a ", "::
+
+   $ hg log -r 0 --template "files: {join(files, ', ')}\n"
+
+- Format date::
+
+   $ hg log -r 0 --template "{date(date, '%Y')}\n"
+
+- Output the description set to a fill-width of 30::
+
+   $ hg log -r 0 --template "{fill(desc, '30')}"
+
+- Use a conditional to test for the default branch::
+
+   $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch',
+   'on branch {branch}')}\n"
+
+- Append a newline if not empty::
+
+   $ hg tip --template "{if(author, '{author}\n')}"
+
+- Label the output for use with the color extension::
+
+   $ hg log -r 0 --template "{label('changeset.{phase}', node|short)}\n"
+
+- Invert the firstline filter, i.e. everything but the first line::
+
+   $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n"
--- a/mercurial/hg.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/hg.py	Fri Feb 01 15:48:33 2013 -0600
@@ -171,14 +171,11 @@
     r = repository(ui, root)
 
     default = srcrepo.ui.config('paths', 'default')
-    if not default:
-        # set default to source for being able to clone subrepos
-        default = os.path.abspath(util.urllocalpath(origsource))
-    fp = r.opener("hgrc", "w", text=True)
-    fp.write("[paths]\n")
-    fp.write("default = %s\n" % default)
-    fp.close()
-    r.ui.setconfig('paths', 'default', default)
+    if default:
+        fp = r.opener("hgrc", "w", text=True)
+        fp.write("[paths]\n")
+        fp.write("default = %s\n" % default)
+        fp.close()
 
     if update:
         r.ui.status(_("updating working directory\n"))
@@ -558,7 +555,7 @@
         revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
 
     other = peer(repo, opts, dest)
-    outgoing = discovery.findcommonoutgoing(repo, other, revs,
+    outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs,
                                             force=opts.get('force'))
     o = outgoing.missing
     if not o:
--- a/mercurial/hgweb/hgweb_mod.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/hgweb/hgweb_mod.py	Fri Feb 01 15:48:33 2013 -0600
@@ -7,7 +7,7 @@
 # GNU General Public License version 2 or any later version.
 
 import os
-from mercurial import ui, hg, hook, error, encoding, templater, util
+from mercurial import ui, hg, hook, error, encoding, templater, util, repoview
 from common import get_stat, ErrorResponse, permhooks, caching
 from common import HTTP_OK, HTTP_NOT_MODIFIED, HTTP_BAD_REQUEST
 from common import HTTP_NOT_FOUND, HTTP_SERVER_ERROR
@@ -24,7 +24,7 @@
     'pushkey': 'push',
 }
 
-def makebreadcrumb(url):
+def makebreadcrumb(url, prefix=''):
     '''Return a 'URL breadcrumb' list
 
     A 'URL breadcrumb' is a list of URL-name pairs,
@@ -33,6 +33,8 @@
     '''
     if url.endswith('/'):
         url = url[:-1]
+    if prefix:
+        url = '/' + prefix + url
     relpath = url
     if relpath.startswith('/'):
         relpath = relpath[1:]
@@ -59,7 +61,7 @@
         else:
             self.repo = repo
 
-        self.repo =  self.repo.filtered('served')
+        self.repo = self._getview(self.repo)
         self.repo.ui.setconfig('ui', 'report_untrusted', 'off')
         self.repo.ui.setconfig('ui', 'nontty', 'true')
         hook.redirect(True)
@@ -86,6 +88,15 @@
         return self.repo.ui.configlist(section, name, default,
                                        untrusted=untrusted)
 
+    def _getview(self, repo):
+        viewconfig = self.config('web', 'view', 'served')
+        if viewconfig == 'all':
+            return repo.unfiltered()
+        elif viewconfig in repoview.filtertable:
+            return repo.filtered(viewconfig)
+        else:
+            return repo.filtered('served')
+
     def refresh(self, request=None):
         if request:
             self.repo.ui.environ = request.env
@@ -96,7 +107,7 @@
             self.mtime = st.st_mtime
             self.size = st.st_size
             self.repo = hg.repository(self.repo.ui, self.repo.root)
-            self.repo =  self.repo.filtered('served')
+            self.repo = self._getview(self.repo)
             self.maxchanges = int(self.config("web", "maxchanges", 10))
             self.stripecount = int(self.config("web", "stripes", 1))
             self.maxshortchanges = int(self.config("web", "maxshortchanges",
@@ -231,10 +242,10 @@
 
             return content
 
-        except error.LookupError, err:
+        except (error.LookupError, error.RepoLookupError), err:
             req.respond(HTTP_NOT_FOUND, ctype)
             msg = str(err)
-            if 'manifest' not in msg:
+            if util.safehasattr(err, 'name') and 'manifest' not in msg:
                 msg = 'revision not found: %s' % err.name
             return tmpl('error', error=msg)
         except (error.RepoError, error.RevlogError), inst:
--- a/mercurial/hgweb/hgwebdir_mod.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/hgweb/hgwebdir_mod.py	Fri Feb 01 15:48:33 2013 -0600
@@ -133,6 +133,12 @@
         if self.stripecount:
             self.stripecount = int(self.stripecount)
         self._baseurl = self.ui.config('web', 'baseurl')
+        prefix = self.ui.config('web', 'prefix', '')
+        if prefix.startswith('/'):
+            prefix = prefix[1:]
+        if prefix.endswith('/'):
+            prefix = prefix[:-1]
+        self.prefix = prefix
         self.lastrefresh = time.time()
 
     def run(self):
@@ -395,7 +401,7 @@
         self.updatereqenv(req.env)
 
         return tmpl("index", entries=entries, subdir=subdir,
-                    pathdef=makebreadcrumb('/' + subdir),
+                    pathdef=makebreadcrumb('/' + subdir, self.prefix),
                     sortcolumn=sortcolumn, descending=descending,
                     **dict(sort))
 
--- a/mercurial/hgweb/webcommands.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/hgweb/webcommands.py	Fri Feb 01 15:48:33 2013 -0600
@@ -129,9 +129,10 @@
         qw = lower(query).split()
 
         def revgen():
+            cl = web.repo.changelog
             for i in xrange(len(web.repo) - 1, 0, -100):
                 l = []
-                for j in xrange(max(0, i - 100), i + 1):
+                for j in cl.revs(max(0, i - 100), i + 1):
                     ctx = web.repo[j]
                     l.append(ctx)
                 l.reverse()
@@ -188,7 +189,7 @@
         if 'rev' in req.form:
             hi = req.form['rev'][0]
         else:
-            hi = len(web.repo) - 1
+            hi = 'tip'
         try:
             ctx = web.repo[hi]
         except error.RepoError:
@@ -292,7 +293,7 @@
                 node=ctx.hex(),
                 parent=webutil.parents(ctx),
                 child=webutil.children(ctx),
-                currentbaseline=basectx.hex(),
+                basenode=basectx.hex(),
                 changesettag=showtags,
                 changesetbookmark=showbookmarks,
                 changesetbranch=showbranch,
@@ -424,7 +425,7 @@
                 latestentry=lambda **x: entries(True, True, **x))
 
 def bookmarks(web, req, tmpl):
-    i = web.repo._bookmarks.items()
+    i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
     parity = paritygen(web.stripecount)
 
     def entries(latestonly, **map):
--- a/mercurial/hgweb/webutil.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/hgweb/webutil.py	Fri Feb 01 15:48:33 2013 -0600
@@ -91,9 +91,9 @@
             if rev not in self._revlog:
                 continue
             if pos < rev < limit:
-                navafter.append(("+%d" % f, self.hex(rev)))
+                navafter.append(("+%d" % abs(rev - pos), self.hex(rev)))
             if 0 < rev < pos:
-                navbefore.append(("-%d" % f, self.hex(rev)))
+                navbefore.append(("-%d" % abs(rev - pos), self.hex(rev)))
 
 
         navafter.append(("tip", "tip"))
--- a/mercurial/localrepo.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/localrepo.py	Fri Feb 01 15:48:33 2013 -0600
@@ -1688,10 +1688,14 @@
                                            "changegroupsubset."))
                 else:
                     cg = remote.changegroupsubset(fetch, heads, 'pull')
-                clstart = len(self.changelog)
+                # we use unfiltered changelog here because hidden revision must
+                # be taken in account for phase synchronization. They may
+                # becomes public and becomes visible again.
+                cl = self.unfiltered().changelog
+                clstart = len(cl)
                 result = self.addchangegroup(cg, 'pull', remote.url())
-                clend = len(self.changelog)
-                added = [self.changelog.node(r) for r in xrange(clstart, clend)]
+                clend = len(cl)
+                added = [cl.node(r) for r in xrange(clstart, clend)]
 
             # compute target subset
             if heads is None:
@@ -1870,6 +1874,20 @@
                     cheads.extend(c.node() for c in revset)
                 # even when we don't push, exchanging phase data is useful
                 remotephases = remote.listkeys('phases')
+                if (self.ui.configbool('ui', '_usedassubrepo', False)
+                    and remotephases    # server supports phases
+                    and ret is None # nothing was pushed
+                    and remotephases.get('publishing', False)):
+                    # When:
+                    # - this is a subrepo push
+                    # - and remote support phase
+                    # - and no changeset was pushed
+                    # - and remote is publishing
+                    # We may be in issue 3871 case!
+                    # We drop the possible phase synchronisation done by
+                    # courtesy to publish changesets possibly locally draft
+                    # on the remote.
+                    remotephases = {'publishing': 'True'}
                 if not remotephases: # old server or public only repo
                     phases.advanceboundary(self, phases.public, cheads)
                     # don't push any phase data as there is nothing to push
--- a/mercurial/merge.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/merge.py	Fri Feb 01 15:48:33 2013 -0600
@@ -228,7 +228,10 @@
                 break
 
     # Compare manifests
-    for f, n in sorted(m1.iteritems()):
+    visit = m1.iteritems()
+    if repo.ui.debugflag:
+        visit = sorted(visit)
+    for f, n in visit:
         if partial and not partial(f):
             continue
         if f in m2:
@@ -248,7 +251,7 @@
             elif nol and n2 == a: # remote only changed 'x'
                 act("update permissions", "e", f, fl2)
             elif nol and n == a: # local only changed 'x'
-                act("remote is newer", "g", f, fl)
+                act("remote is newer", "g", f, fl1)
             else: # both changed something
                 act("versions differ", "m", f, f, f, False)
         elif f in copied: # files we'll deal with on m2 side
@@ -274,7 +277,10 @@
             else:
                 act("other deleted", "r", f)
 
-    for f, n in sorted(m2.iteritems()):
+    visit = m2.iteritems()
+    if repo.ui.debugflag:
+        visit = sorted(visit)
+    for f, n in visit:
         if partial and not partial(f):
             continue
         if f in m1 or f in copied: # files already visited
--- a/mercurial/parsers.c	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/parsers.c	Fri Feb 01 15:48:33 2013 -0600
@@ -1234,8 +1234,14 @@
 				self->ntrev = (int)start;
 		}
 		self->length = start + 1;
-		if (start < self->raw_length)
+		if (start < self->raw_length) {
+			if (self->cache) {
+				Py_ssize_t i;
+				for (i = start; i < self->raw_length; i++)
+					Py_CLEAR(self->cache[i]);
+			}
 			self->raw_length = start;
+		}
 		goto done;
 	}
 
--- a/mercurial/posix.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/posix.py	Fri Feb 01 15:48:33 2013 -0600
@@ -195,6 +195,11 @@
 
     def normcase(path):
         try:
+            path.decode('ascii') # throw exception for non-ASCII character
+            return path.lower()
+        except UnicodeDecodeError:
+            pass
+        try:
             u = path.decode('utf-8')
         except UnicodeDecodeError:
             # percent-encode any characters that don't round-trip
--- a/mercurial/repoview.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/repoview.py	Fri Feb 01 15:48:33 2013 -0600
@@ -9,7 +9,7 @@
 import copy
 import phases
 import util
-import obsolete, bookmarks, revset
+import obsolete, revset
 
 
 def hideablerevs(repo):
@@ -32,7 +32,7 @@
                       if r not in hideable]
         for par in repo[None].parents():
             blockers.append(par.rev())
-        for bm in bookmarks.listbookmarks(repo).values():
+        for bm in repo._bookmarks.values():
             blockers.append(repo[bm].rev())
         blocked = cl.ancestors(blockers, inclusive=True)
         return frozenset(r for r in hideable if r not in blocked)
@@ -72,7 +72,7 @@
 def computeimpactable(repo):
     """Everything impactable by mutable revision
 
-    The mutable filter still have some chance to get invalidated. This will
+    The immutable filter still have some chance to get invalidated. This will
     happen when:
 
     - you garbage collect hidden changeset,
--- a/mercurial/revset.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/revset.py	Fri Feb 01 15:48:33 2013 -0600
@@ -8,7 +8,6 @@
 import re
 import parser, util, error, discovery, hbisect, phases
 import node
-import bookmarks as bookmarksmod
 import match as matchmod
 from i18n import _
 import encoding
@@ -223,13 +222,9 @@
     return stringset(repo, subset, x)
 
 def rangeset(repo, subset, x, y):
-    m = getset(repo, subset, x)
-    if not m:
-        m = getset(repo, list(repo), x)
-
-    n = getset(repo, subset, y)
-    if not n:
-        n = getset(repo, list(repo), y)
+    cl = repo.changelog
+    m = getset(repo, cl, x)
+    n = getset(repo, cl, y)
 
     if not m or not n:
         return []
@@ -326,7 +321,7 @@
         raise error.ParseError(_("~ expects a number"))
     ps = set()
     cl = repo.changelog
-    for r in getset(repo, subset, x):
+    for r in getset(repo, cl, x):
         for i in range(n):
             r = cl.parentrevs(r)[0]
         ps.add(r)
@@ -379,14 +374,14 @@
                        _('the argument to bookmark must be a string'))
         kind, pattern, matcher = _stringmatcher(bm)
         if kind == 'literal':
-            bmrev = bookmarksmod.listbookmarks(repo).get(bm, None)
+            bmrev = repo._bookmarks.get(bm, None)
             if not bmrev:
                 raise util.Abort(_("bookmark '%s' does not exist") % bm)
             bmrev = repo[bmrev].rev()
             return [r for r in subset if r == bmrev]
         else:
             matchrevs = set()
-            for name, bmrev in bookmarksmod.listbookmarks(repo).iteritems():
+            for name, bmrev in repo._bookmarks.iteritems():
                 if matcher(name):
                     matchrevs.add(bmrev)
             if not matchrevs:
@@ -398,7 +393,7 @@
             return [r for r in subset if r in bmrevs]
 
     bms = set([repo[r].rev()
-               for r in bookmarksmod.listbookmarks(repo).values()])
+               for r in repo._bookmarks.values()])
     return [r for r in subset if r in bms]
 
 def branch(repo, subset, x):
@@ -1139,7 +1134,7 @@
         raise error.ParseError(_("^ expects a number 0, 1, or 2"))
     ps = set()
     cl = repo.changelog
-    for r in getset(repo, subset, x):
+    for r in getset(repo, cl, x):
         if n == 0:
             ps.add(r)
         elif n == 1:
--- a/mercurial/scmutil.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/scmutil.py	Fri Feb 01 15:48:33 2013 -0600
@@ -6,6 +6,7 @@
 # GNU General Public License version 2 or any later version.
 
 from i18n import _
+from mercurial.node import nullrev
 import util, error, osutil, revset, similar, encoding, phases
 import match as matchmod
 import os, errno, re, stat, sys, glob
@@ -647,6 +648,8 @@
                 start, end = spec.split(_revrangesep, 1)
                 start = revfix(repo, start, 0)
                 end = revfix(repo, end, len(repo) - 1)
+                if end == nullrev and start <= 0:
+                    start = nullrev
                 rangeiter = repo.changelog.revs(start, end)
                 if not seen and not l:
                     # by far the most common case: revs = ["-1:0"]
--- a/mercurial/subrepo.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/subrepo.py	Fri Feb 01 15:48:33 2013 -0600
@@ -264,6 +264,9 @@
             return repo.ui.config('paths', 'default-push')
         if repo.ui.config('paths', 'default'):
             return repo.ui.config('paths', 'default')
+        if repo.sharedpath != repo.path:
+            # chop off the .hg component to get the default path form
+            return os.path.dirname(repo.sharedpath)
     if abort:
         raise util.Abort(_("default path for subrepository not found"))
 
@@ -420,6 +423,7 @@
             v = r.ui.config(s, k)
             if v:
                 self._repo.ui.setconfig(s, k, v)
+        self._repo.ui.setconfig('ui', '_usedassubrepo', 'True')
         self._initrepo(r, state[0], create)
 
     @annotatesubrepoerror
--- a/mercurial/templates/atom/bookmarkentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/bookmarkentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
  <entry>
   <title>{bookmark|escape}</title>
-  <link rel="alternate" href="{urlbase}{url}rev/{node|short}"/>
-  <id>{urlbase}{url}#bookmark-{node}</id>
+  <link rel="alternate" href="{urlbase}{url|urlescape}rev/{node|short}"/>
+  <id>{urlbase}{url|urlescape}#bookmark-{node}</id>
   <updated>{date|rfc3339date}</updated>
   <published>{date|rfc3339date}</published>
   <content type="text">{bookmark|strip|escape}</content>
--- a/mercurial/templates/atom/bookmarks.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/bookmarks.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
- <id>{urlbase}{url}</id>
- <link rel="self" href="{urlbase}{url}atom-bookmarks"/>
- <link rel="alternate" href="{urlbase}{url}bookmarks"/>
+ <id>{urlbase}{url|urlescape}</id>
+ <link rel="self" href="{urlbase}{url|urlescape}atom-bookmarks"/>
+ <link rel="alternate" href="{urlbase}{url|urlescape}bookmarks"/>
  <title>{repo|escape}: bookmarks</title>
  <summary>{repo|escape} bookmark history</summary>
  <author><name>Mercurial SCM</name></author>
--- a/mercurial/templates/atom/branchentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/branchentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
  <entry>
   <title>{branch|escape}</title>
-  <link rel="alternate" href="{urlbase}{url}rev/{node|short}"/>
-  <id>{urlbase}{url}#branch-{node}</id>
+  <link rel="alternate" href="{urlbase}{url|urlescape}rev/{node|short}"/>
+  <id>{urlbase}{url|urlescape}#branch-{node}</id>
   <updated>{date|rfc3339date}</updated>
   <published>{date|rfc3339date}</published>
   <content type="text"><![CDATA[{branch|strip|escape|addbreaks}]]></content>
--- a/mercurial/templates/atom/branches.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/branches.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
- <id>{urlbase}{url}</id>
- <link rel="self" href="{urlbase}{url}atom-tags"/>
- <link rel="alternate" href="{urlbase}{url}tags"/>
+ <id>{urlbase}{url|urlescape}</id>
+ <link rel="self" href="{urlbase}{url|urlescape}atom-tags"/>
+ <link rel="alternate" href="{urlbase}{url|urlescape}tags"/>
  <title>{repo|escape}: branches</title>
  <summary>{repo|escape} branch history</summary>
  <author><name>Mercurial SCM</name></author>
--- a/mercurial/templates/atom/changelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/changelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,8 +1,8 @@
 {header}
  <!-- Changelog -->
- <id>{urlbase}{url}</id>
- <link rel="self" href="{urlbase}{url}atom-log"/>
- <link rel="alternate" href="{urlbase}{url}"/>
+ <id>{urlbase}{url|urlescape}</id>
+ <link rel="self" href="{urlbase}{url|urlescape}atom-log"/>
+ <link rel="alternate" href="{urlbase}{url|urlescape}"/>
  <title>{repo|escape} Changelog</title>
  {latestentry%feedupdated}
 
--- a/mercurial/templates/atom/changelogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/changelogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
  <entry>
   <title>{desc|strip|firstline|strip|escape|nonempty}</title>
-  <id>{urlbase}{url}#changeset-{node}</id>
-  <link href="{urlbase}{url}rev/{node|short}"/>
+  <id>{urlbase}{url|urlescape}#changeset-{node}</id>
+  <link href="{urlbase}{url|urlescape}rev/{node|short}"/>
   <author>
    <name>{author|person|escape}</name>
    <email>{author|email|obfuscate}</email>
--- a/mercurial/templates/atom/error.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/error.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,8 +1,8 @@
 {header}
  <!-- Error -->
- <id>{urlbase}{url}</id>
- <link rel="self" href="{urlbase}{url}atom-log"/>
- <link rel="alternate" href="{urlbase}{url}"/>
+ <id>{urlbase}{url|urlescape}</id>
+ <link rel="self" href="{urlbase}{url|urlescape}atom-log"/>
+ <link rel="alternate" href="{urlbase}{url|urlescape}"/>
  <title>Error</title>
  <updated>1970-01-01T00:00:00+00:00</updated>
  <entry>
--- a/mercurial/templates/atom/filelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/filelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,6 +1,6 @@
 {header}
- <id>{urlbase}{url}atom-log/tip/{file|escape}</id>
- <link rel="self" href="{urlbase}{url}atom-log/tip/{file|urlescape}"/>
+ <id>{urlbase}{url|urlescape}atom-log/tip/{file|escape}</id>
+ <link rel="self" href="{urlbase}{url|urlescape}atom-log/tip/{file|urlescape}"/>
  <title>{repo|escape}: {file|escape} history</title>
  {latestentry%feedupdated}
 
--- a/mercurial/templates/atom/tagentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/tagentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
  <entry>
   <title>{tag|escape}</title>
-  <link rel="alternate" href="{urlbase}{url}rev/{node|short}"/>
-  <id>{urlbase}{url}#tag-{node}</id>
+  <link rel="alternate" href="{urlbase}{url|urlescape}rev/{node|short}"/>
+  <id>{urlbase}{url|urlescape}#tag-{node}</id>
   <updated>{date|rfc3339date}</updated>
   <published>{date|rfc3339date}</published>
   <content type="text">{tag|strip|escape}</content>
--- a/mercurial/templates/atom/tags.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/atom/tags.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
- <id>{urlbase}{url}</id>
- <link rel="self" href="{urlbase}{url}atom-tags"/>
- <link rel="alternate" href="{urlbase}{url}tags"/>
+ <id>{urlbase}{url|urlescape}</id>
+ <link rel="self" href="{urlbase}{url|urlescape}atom-tags"/>
+ <link rel="alternate" href="{urlbase}{url|urlescape}tags"/>
  <title>{repo|escape}: tags</title>
  <summary>{repo|escape} tag history</summary>
  <author><name>Mercurial SCM</name></author>
--- a/mercurial/templates/coal/header.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/coal/header.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
 <head>
-<link rel="icon" href="{staticurl}hgicon.png" type="image/png" />
+<link rel="icon" href="{staticurl|urlescape}hgicon.png" type="image/png" />
 <meta name="robots" content="index, nofollow" />
-<link rel="stylesheet" href="{staticurl}style-coal.css" type="text/css" />
-<script type="text/javascript" src="{staticurl}mercurial.js"></script>
+<link rel="stylesheet" href="{staticurl|urlescape}style-coal.css" type="text/css" />
+<script type="text/javascript" src="{staticurl|urlescape}mercurial.js"></script>
--- a/mercurial/templates/coal/map	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/coal/map	Fri Feb 01 15:48:33 2013 -0600
@@ -13,14 +13,14 @@
 help = ../paper/help.tmpl
 helptopics = ../paper/helptopics.tmpl
 
-helpentry = '<tr><td><a href="{url}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
+helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
 
-naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navgraphentry = '<a href="{url}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
-filedifflink = '<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
-filenodelink = '<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navgraphentry = '<a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+filenaventry = '<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
+filedifflink = '<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+filenodelink = '<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
 filenolink = '{file|escape} '
 fileellipses = '...'
 diffstatlink = ../paper/diffstat.tmpl
@@ -38,10 +38,10 @@
 direntry = '
   <tr class="fileline parity{parity}">
     <td class="name">
-      <a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">
-        <img src="{staticurl}coal-folder.png" alt="dir."/> {basename|escape}/
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">
+        <img src="{staticurl|urlescape}coal-folder.png" alt="dir."/> {basename|escape}/
       </a>
-      <a href="{url}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">
         {emptydirs|escape}
       </a>
     </td>
@@ -52,8 +52,8 @@
 fileentry = '
   <tr class="fileline parity{parity}">
     <td class="filename">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
-        <img src="{staticurl}coal-file.png" alt="file"/> {basename|escape}
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+        <img src="{staticurl|urlescape}coal-file.png" alt="file"/> {basename|escape}
       </a>
     </td>
     <td class="size">{size}</td>
@@ -72,7 +72,7 @@
 annotateline = '
   <tr class="parity{parity}">
     <td class="annotate">
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#{targetline}"
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#{targetline}"
          title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
     </td>
     <td class="source"><a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}</td>
@@ -97,19 +97,19 @@
 changelogparent = '
   <tr>
     <th class="parent">parent {rev}:</th>
-    <td class="parent"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="parent"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 
-changesetparent = '<a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a> '
+changesetparent = '<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a> '
 
-filerevparent = '<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a> '
-filerevchild = '<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a> '
+filerevparent = '<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a> '
+filerevchild = '<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a> '
 
 filerename = '{file|escape}@'
 filelogrename = '
   <span class="base">
     base
-    <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+    <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
       {file|escape}@{node|short}
     </a>
   </span>'
@@ -117,17 +117,17 @@
   <tr>
     <td class="metatag">parent:</td>
     <td>
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {rename%filerename}{node|short}
       </a>
     </td>
   </tr>'
-changesetchild = ' <a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>'
+changesetchild = ' <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>'
 changelogchild = '
   <tr>
     <th class="child">child</th>
     <td class="child">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         {node|short}
       </a>
     </td>
@@ -136,7 +136,7 @@
   <tr>
     <td class="metatag">child:</td>
     <td>
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {node|short}
       </a>
     </td>
@@ -145,7 +145,7 @@
 tagentry = '
   <tr class="tagEntry parity{parity}">
     <td>
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         {tag|escape}
       </a>
     </td>
@@ -157,7 +157,7 @@
 bookmarkentry = '
   <tr class="tagEntry parity{parity}">
     <td>
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         {bookmark|escape}
       </a>
     </td>
@@ -169,7 +169,7 @@
 branchentry = '
   <tr class="tagEntry parity{parity}">
     <td>
-      <a href="{url}shortlog/{node|short}{sessionvars%urlparameter}" class="{status}">
+      <a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}" class="{status}">
         {branch|escape}
       </a>
     </td>
@@ -186,41 +186,41 @@
 filediffparent = '
   <tr>
     <th class="parent">parent {rev}:</th>
-    <td class="parent"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="parent"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filelogparent = '
   <tr>
     <th>parent {rev}:</th>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filediffchild = '
   <tr>
     <th class="child">child {rev}:</th>
-    <td class="child"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+    <td class="child"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
   </td>
   </tr>'
 filelogchild = '
   <tr>
     <th>child {rev}:</th>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 
 indexentry = '
   <tr class="parity{parity}">
-    <td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td>
+    <td><a href="{url|urlescape}{sessionvars%urlparameter}">{name|escape}</a></td>
     <td>{description}</td>
     <td>{contact|obfuscate}</td>
     <td class="age">{lastchange|rfc822date}</td>
     <td class="indexlinks">{archives%indexarchiveentry}</td>
   </tr>\n'
-indexarchiveentry = '<a href="{url}archive/{node|short}{extension|urlescape}">&nbsp;&darr;{type|escape}</a>'
+indexarchiveentry = '<a href="{url|urlescape}archive/{node|short}{extension|urlescape}">&nbsp;&darr;{type|escape}</a>'
 index = ../paper/index.tmpl
 archiveentry = '
   <li>
-    <a href="{url}archive/{node|short}{extension|urlescape}">{type|escape}</a>
+    <a href="{url|urlescape}archive/{node|short}{extension|urlescape}">{type|escape}</a>
   </li>'
 notfound = ../paper/notfound.tmpl
 error = ../paper/error.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
-breadcrumb = '&gt; <a href="{url}">{name}</a> '
+breadcrumb = '&gt; <a href="{url|urlescape}">{name|escape}</a> '
--- a/mercurial/templates/gitweb/bookmarks.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/bookmarks.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Bookmarks</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-bookmarks" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-bookmarks" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-bookmarks" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-bookmarks" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,15 +13,15 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 bookmarks |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
--- a/mercurial/templates/gitweb/branches.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/branches.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Branches</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-branches" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-branches" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-branches" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-branches" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,15 +13,15 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 branches |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
--- a/mercurial/templates/gitweb/changelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/changelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Changelog</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -12,7 +12,7 @@
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / changelog
 </div>
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <div class="search">
 <input type="text" name="rev"  />
@@ -20,15 +20,15 @@
 </form>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a> |
 changelog |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 {changenav%nav}<br/>
 </div>
--- a/mercurial/templates/gitweb/changelogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/changelogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 <div>
-<a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}"><span class="age">{date|rfc822date}</span>{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a>
+<a class="title" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"><span class="age">{date|rfc822date}</span>{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a>
 </div>
 <div class="title_text">
 <div class="log_link">
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a><br/>
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a><br/>
 </div>
 <i>{author|obfuscate} [{date|rfc822date}] rev {rev}</i><br/>
 </div>
--- a/mercurial/templates/gitweb/changeset.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/changeset.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: changeset {rev}:{node|short}</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,22 +13,22 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
 changeset |
-<a href="{url}raw-rev/{node|short}">raw</a> {archives%archiveentry} |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}raw-rev/{node|short}">raw</a> {archives%archiveentry} |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
 <div>
-<a class="title" href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a>
+<a class="title" href="{url|urlescape}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a>
 </div>
 <div class="title_text">
 <table cellspacing="0">
--- a/mercurial/templates/gitweb/error.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/error.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Error</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,14 +13,14 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
--- a/mercurial/templates/gitweb/fileannotate.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/fileannotate.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: {file|escape}@{node|short} (annotated)</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,23 +13,23 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-<a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a> |
-<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+<a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a> |
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
 annotate |
-<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-<a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
-<a href="{url}raw-annotate/{node|short}/{file|urlescape}">raw</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+<a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
+<a href="{url|urlescape}raw-annotate/{node|short}/{file|urlescape}">raw</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
@@ -46,7 +46,7 @@
 {branch%filerevbranch}
 <tr>
  <td>changeset {rev}</td>
- <td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
+ <td style="font-family:monospace"><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
 {parent%fileannotateparent}
 {child%fileannotatechild}
 <tr>
--- a/mercurial/templates/gitweb/filecomparison.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/filecomparison.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: comparison {file|escape}</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,23 +13,23 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-<a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a> |
-<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
-<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
-<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+<a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a> |
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
+<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
+<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
 comparison |
-<a href="{url}raw-diff/{node|short}/{file|urlescape}">raw</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}raw-diff/{node|short}/{file|urlescape}">raw</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
@@ -39,7 +39,7 @@
 {branch%filerevbranch}
 <tr>
  <td>changeset {rev}</td>
- <td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
+ <td style="font-family:monospace"><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
 {parent%filecompparent}
 {child%filecompchild}
 </table>
--- a/mercurial/templates/gitweb/filediff.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/filediff.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: diff {file|escape}</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,23 +13,23 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-<a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a> |
-<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
-<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+<a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a> |
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
+<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
 diff |
-<a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
-<a href="{url}raw-diff/{node|short}/{file|urlescape}">raw</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
+<a href="{url|urlescape}raw-diff/{node|short}/{file|urlescape}">raw</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
@@ -39,7 +39,7 @@
 {branch%filerevbranch}
 <tr>
  <td>changeset {rev}</td>
- <td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
+ <td style="font-family:monospace"><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
 {parent%filediffparent}
 {child%filediffchild}
 </table>
--- a/mercurial/templates/gitweb/filelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/filelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: File revisions</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,20 +13,20 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
 revisions |
-<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
-<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-<a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
-<a href="{url}rss-log/tip/{file|urlescape}">rss</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
+<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+<a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
+<a href="{url|urlescape}rss-log/tip/{file|urlescape}">rss</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 {nav%filenav}
 </div>
--- a/mercurial/templates/gitweb/filerevision.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/filerevision.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: {file|escape}@{node|short}</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,23 +13,23 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
 file |
-<a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a> |
-<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
-<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
-<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-<a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
-<a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a> |
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
+<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
+<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+<a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
+<a href="{url|urlescape}raw-file/{node|short}/{file|urlescape}">raw</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
@@ -46,7 +46,7 @@
 {branch%filerevbranch}
 <tr>
  <td>changeset {rev}</td>
- <td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
+ <td style="font-family:monospace"><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
 {parent%filerevparent}
 {child%filerevchild}
 <tr>
--- a/mercurial/templates/gitweb/footer.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/footer.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -2,8 +2,8 @@
 <div class="page_footer">
 <div class="page_footer_text">{repo|escape}</div>
 <div class="rss_logo">
-<a href="{url}rss-log">RSS</a>
-<a href="{url}atom-log">Atom</a>
+<a href="{url|urlescape}rss-log">RSS</a>
+<a href="{url|urlescape}atom-log">Atom</a>
 </div>
 <br />
 {motd}
--- a/mercurial/templates/gitweb/graph.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/graph.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,10 +1,10 @@
 {header}
 <title>{repo|escape}: Graph</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
-<!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
+<!--[if IE]><script type="text/javascript" src="{staticurl|urlescape}excanvas.js"></script><![endif]-->
 </head>
 <body>
 
@@ -13,25 +13,25 @@
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / graph
 </div>
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <div class="search">
 <input type="text" name="rev"  />
 </div>
 </form>
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a> |
 graph |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
-<a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
-<a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
 | {changenav%navgraph}<br/>
 </div>
 
@@ -89,7 +89,7 @@
 	}
 	
 	var item = '<li style="' + nstyle + '"><span class="desc">';
-	item += '<a class="list" href="{url}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '"><b>' + cur[3] + '</b></a>';
+	item += '<a class="list" href="{url|urlescape}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '"><b>' + cur[3] + '</b></a>';
 	item += '</span> ' + tagspan + '';
 	item += '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
 
@@ -103,8 +103,8 @@
 </script>
 
 <div class="page_nav">
-<a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
-<a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
 | {changenav%navgraph}
 </div>
 
--- a/mercurial/templates/gitweb/header.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/header.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -2,7 +2,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
 <head>
-<link rel="icon" href="{staticurl}hgicon.png" type="image/png" />
+<link rel="icon" href="{staticurl|urlescape}hgicon.png" type="image/png" />
 <meta name="robots" content="index, nofollow"/>
-<link rel="stylesheet" href="{staticurl}style-gitweb.css" type="text/css" />
-<script type="text/javascript" src="{staticurl}mercurial.js"></script>
+<link rel="stylesheet" href="{staticurl|urlescape}style-gitweb.css" type="text/css" />
+<script type="text/javascript" src="{staticurl|urlescape}mercurial.js"></script>
--- a/mercurial/templates/gitweb/help.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/help.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Branches</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-tags" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-tags" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,14 +13,14 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
 help
 <br/>
 </div>
--- a/mercurial/templates/gitweb/helptopics.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/helptopics.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Branches</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-tags" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-tags" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,14 +13,14 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
 help
 <br/>
 </div>
--- a/mercurial/templates/gitweb/manifest.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/manifest.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: files</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,16 +13,16 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
 files |
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> {archives%archiveentry} |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> {archives%archiveentry} |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
@@ -32,7 +32,7 @@
 <td style="font-family:monospace">drwxr-xr-x</td>
 <td style="font-family:monospace"></td>
 <td style="font-family:monospace"></td>
-<td><a href="{url}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td>
+<td><a href="{url|urlescape}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td>
 <td class="link">&nbsp;</td>
 </tr>
 {dentries%direntry}
--- a/mercurial/templates/gitweb/map	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/map	Fri Feb 01 15:48:33 2013 -0600
@@ -11,35 +11,35 @@
 help = help.tmpl
 helptopics = helptopics.tmpl
 
-helpentry = '<tr><td><a href="{url}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
+helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
 
-naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navgraphentry = '<a href="{url}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
-filedifflink = '<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navgraphentry = '<a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+filenaventry = '<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
+filedifflink = '<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
 filenodelink = '
   <tr class="parity{parity}">
-    <td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
+    <td><a class="list" href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
     <td></td>
     <td class="link">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
-      <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-      <a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
+      <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+      <a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
+      <a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
     </td>
   </tr>'
 filenolink = '
   <tr class="parity{parity}">
-    <td><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
+    <td><a class="list" href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
     <td></td>
     <td class="link">
       file |
       annotate |
-      <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-      <a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+      <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+      <a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
+      <a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
     </td>
   </tr>'
 
@@ -59,11 +59,11 @@
     <td style="font-family:monospace"></td>
     <td style="font-family:monospace"></td>
     <td>
-      <a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>
-      <a href="{url}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">{emptydirs|escape}</a>
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">{emptydirs|escape}</a>
     </td>
     <td class="link">
-      <a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 fileentry = '
@@ -72,12 +72,12 @@
     <td style="font-family:monospace" align=right>{date|isodate}</td>
     <td style="font-family:monospace" align=right>{size}</td>
     <td class="list">
-      <a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>
+      <a class="list" href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>
     </td>
     <td class="link">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+      <a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
     </td>
   </tr>'
 filerevision = filerevision.tmpl
@@ -92,7 +92,7 @@
 annotateline = '
   <tr style="font-family:monospace" class="parity{parity}">
     <td class="linenr" style="text-align: right;">
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
          title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
     </td>
     <td><pre><a class="linenr" href="#{lineid}" id="{lineid}">{linenumber}</a></pre></td>
@@ -117,34 +117,34 @@
   <tr>
     <th class="parent">parent {rev}:</th>
     <td class="parent">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
     </td>
   </tr>'
-changesetbranch = '<tr><td>branch</td><td>{name}</td></tr>'
+changesetbranch = '<tr><td>branch</td><td>{name|escape}</td></tr>'
 changesetparent = '
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+      <a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
     </td>
   </tr>'
-filerevbranch = '<tr><td>branch</td><td>{name}</td></tr>'
+filerevbranch = '<tr><td>branch</td><td>{name|escape}</td></tr>'
 filerevparent = '
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a class="list" href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {rename%filerename}{node|short}
       </a>
     </td>
   </tr>'
 filerename = '{file|escape}@'
-filelogrename = '| <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">base</a>'
+filelogrename = '| <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">base</a>'
 fileannotateparent = '
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a class="list" href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {rename%filerename}{node|short}
       </a>
     </td>
@@ -152,59 +152,59 @@
 changelogchild = '
   <tr>
     <th class="child">child {rev}:</th>
-    <td class="child"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="child"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 changesetchild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+      <a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
     </td>
   </tr>'
 filerevchild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+      <a class="list" href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
     </tr>'
 fileannotatechild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+      <a class="list" href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
     </tr>'
 tags = tags.tmpl
 tagentry = '
   <tr class="parity{parity}">
     <td class="age"><i class="age">{date|rfc822date}</i></td>
-    <td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{tag|escape}</b></a></td>
+    <td><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"><b>{tag|escape}</b></a></td>
     <td class="link">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-      <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
-      <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+      <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
+      <a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 bookmarks = bookmarks.tmpl
 bookmarkentry = '
   <tr class="parity{parity}">
     <td class="age"><i class="age">{date|rfc822date}</i></td>
-    <td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{bookmark|escape}</b></a></td>
+    <td><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"><b>{bookmark|escape}</b></a></td>
     <td class="link">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-      <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
-      <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+      <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
+      <a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 branches = branches.tmpl
 branchentry = '
   <tr class="parity{parity}">
     <td class="age"><i class="age">{date|rfc822date}</i></td>
-    <td><a class="list" href="{url}shortlog/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></a></td>
+    <td><a class="list" href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></a></td>
     <td class="{status}">{branch|escape}</td>
     <td class="link">
-      <a href="{url}changeset/{node|short}{sessionvars%urlparameter}">changeset</a> |
-      <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
-      <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}changeset/{node|short}{sessionvars%urlparameter}">changeset</a> |
+      <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
+      <a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 diffblock = '<pre>{lines}</pre>'
@@ -212,7 +212,7 @@
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a class="list" href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {node|short}
       </a>
     </td>
@@ -221,7 +221,7 @@
   <tr>
     <td>parent {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a class="list" href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {node|short}
       </a>
     </td>
@@ -229,64 +229,64 @@
 filelogparent = '
   <tr>
     <td align="right">parent {rev}:&nbsp;</td>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filediffchild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
+      <a class="list" href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
     </td>
   </tr>'
 filecompchild = '
   <tr>
     <td>child {rev}</td>
     <td style="font-family:monospace">
-      <a class="list" href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
+      <a class="list" href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
     </td>
   </tr>'
 filelogchild = '
   <tr>
     <td align="right">child {rev}:&nbsp;</td>
-    <td><a href="{url}file{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 shortlog = shortlog.tmpl
 graph = graph.tmpl
-tagtag = '<span class="tagtag" title="{name}">{name}</span> '
-branchtag = '<span class="branchtag" title="{name}">{name}</span> '
-inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> '
-bookmarktag = '<span class="bookmarktag" title="{name}">{name}</span> '
+tagtag = '<span class="tagtag" title="{name|escape}">{name|escape}</span> '
+branchtag = '<span class="branchtag" title="{name|escape}">{name|escape}</span> '
+inbranchtag = '<span class="inbranchtag" title="{name|escape}">{name|escape}</span> '
+bookmarktag = '<span class="bookmarktag" title="{name|escape}">{name|escape}</span> '
 shortlogentry = '
   <tr class="parity{parity}">
     <td class="age"><i class="age">{date|rfc822date}</i></td>
     <td><i>{author|person}</i></td>
     <td>
-      <a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         <b>{desc|strip|firstline|escape|nonempty}</b>
         <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span>
       </a>
     </td>
     <td class="link" nowrap>
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-      <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+      <a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 filelogentry = '
   <tr class="parity{parity}">
     <td class="age"><i class="age">{date|rfc822date}</i></td>
     <td>
-      <a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         <b>{desc|strip|firstline|escape|nonempty}</b>
       </a>
     </td>
     <td class="link">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> {rename%filelogrename}</td>
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> {rename%filelogrename}</td>
     </tr>'
-archiveentry = ' | <a href="{url}archive/{node|short}{extension}">{type|escape}</a> '
+archiveentry = ' | <a href="{url|urlescape}archive/{node|short}{extension}">{type|escape}</a> '
 indexentry = '
   <tr class="parity{parity}">
     <td>
-      <a class="list" href="{url}{sessionvars%urlparameter}">
+      <a class="list" href="{url|urlescape}{sessionvars%urlparameter}">
         <b>{name|escape}</b>
       </a>
     </td>
@@ -296,13 +296,13 @@
     <td class="indexlinks">{archives%indexarchiveentry}</td>
     <td>{if(isdirectory, '',
             '<div class="rss_logo">
-                <a href="{url}rss-log">RSS</a> <a href="{url}atom-log">Atom</a>
+                <a href="{url|urlescape}rss-log">RSS</a> <a href="{url|urlescape}atom-log">Atom</a>
             </div>'
             )}
     </td>
   </tr>\n'
-indexarchiveentry = ' <a href="{url}archive/{node|short}{extension}">{type|escape}</a> '
+indexarchiveentry = ' <a href="{url|urlescape}archive/{node|short}{extension}">{type|escape}</a> '
 index = index.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
-breadcrumb = '&gt; <a href="{url}">{name}</a> '
+breadcrumb = '&gt; <a href="{url|urlescape}">{name|escape}</a> '
--- a/mercurial/templates/gitweb/notfound.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/notfound.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -12,7 +12,7 @@
 The specified repository "{repo|escape}" is unknown, sorry.
 <br/>
 <br/>
-Please go back to the <a href="{url}">main repository list page</a>.
+Please go back to the <a href="{url|urlescape}">main repository list page</a>.
 </div>
 
 {footer}
--- a/mercurial/templates/gitweb/search.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/search.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Search</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -11,7 +11,7 @@
 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / search
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <div class="search">
 <input type="text" name="rev" value="{query|escape}" />
@@ -20,16 +20,16 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}
  |
- <a href="{url}help{sessionvars%urlparameter}">help</a>
+ <a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
--- a/mercurial/templates/gitweb/shortlog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/shortlog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Shortlog</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -12,22 +12,22 @@
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / shortlog
 </div>
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <div class="search">
 <input type="text" name="rev"  />
 </div>
 </form>
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
 shortlog |
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>{changenav%navshort}<br/>
 </div>
 
--- a/mercurial/templates/gitweb/summary.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/summary.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,16 +1,16 @@
 {header}
 <title>{repo|escape}: Summary</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
 <div class="page_header">
 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / summary
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <div class="search">
 <input type="text" name="rev"  />
@@ -20,14 +20,14 @@
 
 <div class="page_nav">
 summary |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
-<a href="{url}tags{sessionvars%urlparameter}">tags</a> |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry} |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
@@ -38,29 +38,29 @@
 <tr><td>last change</td><td>{lastchange|rfc822date}</td></tr>
 </table>
 
-<div><a  class="title" href="{url}shortlog{sessionvars%urlparameter}">changes</a></div>
+<div><a  class="title" href="{url|urlescape}shortlog{sessionvars%urlparameter}">changes</a></div>
 <table cellspacing="0">
 {shortlog}
-<tr class="light"><td colspan="4"><a class="list" href="{url}shortlog{sessionvars%urlparameter}">...</a></td></tr>
+<tr class="light"><td colspan="4"><a class="list" href="{url|urlescape}shortlog{sessionvars%urlparameter}">...</a></td></tr>
 </table>
 
-<div><a class="title" href="{url}tags{sessionvars%urlparameter}">tags</a></div>
+<div><a class="title" href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></div>
 <table cellspacing="0">
 {tags}
-<tr class="light"><td colspan="3"><a class="list" href="{url}tags{sessionvars%urlparameter}">...</a></td></tr>
+<tr class="light"><td colspan="3"><a class="list" href="{url|urlescape}tags{sessionvars%urlparameter}">...</a></td></tr>
 </table>
 
-<div><a class="title" href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></div>
+<div><a class="title" href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></div>
 <table cellspacing="0">
 {bookmarks%bookmarkentry}
-<tr class="light"><td colspan="3"><a class="list" href="{url}bookmarks{sessionvars%urlparameter}">...</a></td></tr>
+<tr class="light"><td colspan="3"><a class="list" href="{url|urlescape}bookmarks{sessionvars%urlparameter}">...</a></td></tr>
 </table>
 
-<div><a class="title" href="{url}branches{sessionvars%urlparameter}">branches</a></div>
+<div><a class="title" href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></div>
 <table cellspacing="0">
 {branches%branchentry}
 <tr class="light">
-  <td colspan="4"><a class="list"  href="{url}branches{sessionvars%urlparameter}">...</a></td>
+  <td colspan="4"><a class="list"  href="{url|urlescape}branches{sessionvars%urlparameter}">...</a></td>
 </tr>
 </table>
 {footer}
--- a/mercurial/templates/gitweb/tags.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/gitweb/tags.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: Tags</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-tags" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-tags" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
@@ -13,15 +13,15 @@
 </div>
 
 <div class="page_nav">
-<a href="{url}summary{sessionvars%urlparameter}">summary</a> |
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
-<a href="{url}log{sessionvars%urlparameter}">changelog</a> |
-<a href="{url}graph{sessionvars%urlparameter}">graph</a> |
+<a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
 tags |
-<a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
-<a href="{url}branches{sessionvars%urlparameter}">branches</a> |
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> |
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a> |
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 <br/>
 </div>
 
--- a/mercurial/templates/monoblue/bookmarks.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/bookmarks.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Bookmarks</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / bookmarks</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,15 +18,15 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
             <li class="current">bookmarks</li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
-	    <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+	    <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
--- a/mercurial/templates/monoblue/branches.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/branches.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Branches</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-branches" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-branches" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-branches" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-branches" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / branches</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,15 +18,15 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
             <li class="current">branches</li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
-	    <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+	    <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
--- a/mercurial/templates/monoblue/changelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/changelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: changelog</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / changelog</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,15 +18,15 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
             <li class="current">changelog</li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}</li>
-	    <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}</li>
+	    <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
--- a/mercurial/templates/monoblue/changelogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/changelogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,4 +1,4 @@
-<h3 class="changelog"><a class="title" href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3>
+<h3 class="changelog"><a class="title" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3>
 <ul class="changelog-entry">
     <li class="age">{date|rfc822date}</li>
     <li>by <span class="name">{author|obfuscate}</span> <span class="revdate">[{date|rfc822date}] rev {rev}</span></li>
--- a/mercurial/templates/monoblue/changeset.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/changeset.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
 <title>{repo|escape}: changeset {rev}:{node|short}</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,26 +18,26 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
     <ul class="submenu">
         <li class="current">changeset</li>
-        <li><a href="{url}raw-rev/{node|short}">raw</a> {archives%archiveentry}</li>
+        <li><a href="{url|urlescape}raw-rev/{node|short}">raw</a> {archives%archiveentry}</li>
     </ul>
 
     <h2 class="no-link no-border">changeset</h2>
 
-    <h3 class="changeset"><a href="{url}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3>
+    <h3 class="changeset"><a href="{url|urlescape}raw-rev/{node|short}">{desc|strip|escape|firstline|nonempty} <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span></a></h3>
     <p class="changeset-age age">{date|rfc822date}</p>
 
     <dl class="overview">
--- a/mercurial/templates/monoblue/error.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/error.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Error</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / not found: {repo|escape}</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -19,14 +19,14 @@
 
         <ul class="page-nav">
             <li class="current">summary</li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
--- a/mercurial/templates/monoblue/fileannotate.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/fileannotate.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
 <title>{repo|escape}: {file|escape}@{node|short} (annotated)</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / annotate</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,25 +18,25 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
     <ul class="submenu">
-        <li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
-        <li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
+        <li><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
+        <li><a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
         <li class="current">annotate</li>
-        <li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
-        <li><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
-        <li><a href="{url}raw-annotate/{node|short}/{file|urlescape}">raw</a></li>
+        <li><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+        <li><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
+        <li><a href="{url|urlescape}raw-annotate/{node|short}/{file|urlescape}">raw</a></li>
     </ul>
 
     <h2 class="no-link no-border">{file|escape}@{node|short} (annotated)</h2>
@@ -50,7 +50,7 @@
         <dd>{date|rfc822date}</dd>
         {branch%filerevbranch}
         <dt>changeset {rev}</dt>
-        <dd><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
+        <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
         {parent%fileannotateparent}
         {child%fileannotatechild}
         <dt>permissions</dt>
--- a/mercurial/templates/monoblue/filecomparison.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/filecomparison.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
 <title>{repo|escape}: comparison {file|escape}</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file comparison</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,25 +18,25 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
     <ul class="submenu">
-        <li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
-        <li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
-        <li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
-        <li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+        <li><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
+        <li><a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
+        <li><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
+        <li><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
         <li class="current">comparison</li>
-        <li><a href="{url}raw-diff/{node|short}/{file|urlescape}">raw</a></li>
+        <li><a href="{url|urlescape}raw-diff/{node|short}/{file|urlescape}">raw</a></li>
     </ul>
 
     <h2 class="no-link no-border">comparison: {file|escape}</h2>
@@ -45,7 +45,7 @@
     <dl class="overview">
         {branch%filerevbranch}
         <dt>changeset {rev}</dt>
-        <dd><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
+        <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
         {parent%filecompparent}
         {child%filecompchild}
     </dl>
--- a/mercurial/templates/monoblue/filediff.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/filediff.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
 <title>{repo|escape}: diff {file|escape}</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file diff</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,25 +18,25 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
     <ul class="submenu">
-        <li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
-        <li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
-        <li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
+        <li><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
+        <li><a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
+        <li><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
         <li class="current">diff</li>
-        <li><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
-        <li><a href="{url}raw-diff/{node|short}/{file|urlescape}">raw</a></li>
+        <li><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
+        <li><a href="{url|urlescape}raw-diff/{node|short}/{file|urlescape}">raw</a></li>
     </ul>
 
     <h2 class="no-link no-border">diff: {file|escape}</h2>
@@ -45,7 +45,7 @@
     <dl class="overview">
         {branch%filerevbranch}
         <dt>changeset {rev}</dt>
-        <dd><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
+        <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
         {parent%filediffparent}
         {child%filediffchild}
     </dl>
--- a/mercurial/templates/monoblue/filelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/filelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
 <title>{repo|escape}: File revisions</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file revisions</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,25 +18,25 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
     <ul class="submenu">
-        <li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
+        <li><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
         <li class="current">revisions</li>
-        <li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
-        <li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
-        <li><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
-        <li><a href="{url}rss-log/tip/{file|urlescape}">rss</a></li>
+        <li><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
+        <li><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+        <li><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
+        <li><a href="{url|urlescape}rss-log/tip/{file|urlescape}">rss</a></li>
     </ul>
 
     <h2 class="no-link no-border">{file|urlescape}</h2>
--- a/mercurial/templates/monoblue/filerevision.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/filerevision.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
 <title>{repo|escape}: {file|escape}@{node|short}</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file revision</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,25 +18,25 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
     <ul class="submenu">
         <li class="current">file</li>
-        <li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
-        <li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
-        <li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
-        <li><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
-        <li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
+        <li><a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a></li>
+        <li><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
+        <li><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+        <li><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
+        <li><a href="{url|urlescape}raw-file/{node|short}/{file|urlescape}">raw</a></li>
     </ul>
 
     <h2 class="no-link no-border">{file|escape}@{node|short}</h2>
@@ -50,7 +50,7 @@
         <dd>{date|rfc822date}</dd>
         {branch%filerevbranch}
         <dt>changeset {rev}</dt>
-        <dd><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
+        <dd><a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>
         {parent%filerevparent}
         {child%filerevchild}
         <dt>permissions</dt>
--- a/mercurial/templates/monoblue/footer.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/footer.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -2,14 +2,14 @@
     <div class="page-footer">
         <p>Mercurial Repository: {repo|escape}</p>
         <ul class="rss-logo">
-            <li><a href="{url}rss-log">RSS</a></li>
-            <li><a href="{url}atom-log">Atom</a></li>
+            <li><a href="{url|urlescape}rss-log">RSS</a></li>
+            <li><a href="{url|urlescape}atom-log">Atom</a></li>
         </ul>
         {motd}
     </div>
 
     <div id="powered-by">
-        <p><a href="{logourl}" title="Mercurial"><img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a></p>
+        <p><a href="{logourl}" title="Mercurial"><img src="{staticurl|urlescape}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a></p>
     </div>
 
     <div id="corner-top-left"></div>
--- a/mercurial/templates/monoblue/graph.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/graph.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,8 +1,8 @@
 {header}
     <title>{repo|escape}: graph</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
-    <!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
+    <!--[if IE]><script type="text/javascript" src="{staticurl|urlescape}excanvas.js"></script><![endif]-->
 </head>
 
 <body>
@@ -10,7 +10,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / graph</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -19,15 +19,15 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
             <li class="current">graph</li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
-	    <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+	    <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
@@ -86,7 +86,7 @@
         }
 
         var item = '<li style="' + nstyle + '"><span class="desc">';
-        item += '<a href="{url}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>';
+        item += '<a href="{url|urlescape}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>';
         item += '</span>' + tagspan + '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
 
         return [bg, item];
@@ -99,8 +99,8 @@
     </script>
 
     <div class="page-path">
-        <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
-        <a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
+        <a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
+        <a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
         | {changenav%navgraph}
     </div>
 
--- a/mercurial/templates/monoblue/header.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/header.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-    <link rel="icon" href="{staticurl}hgicon.png" type="image/png" />
+    <link rel="icon" href="{staticurl|urlescape}hgicon.png" type="image/png" />
     <meta name="robots" content="index, nofollow"/>
-    <link rel="stylesheet" href="{staticurl}style-monoblue.css" type="text/css" />
-    <script type="text/javascript" src="{staticurl}mercurial.js"></script>
+    <link rel="stylesheet" href="{staticurl|urlescape}style-monoblue.css" type="text/css" />
+    <script type="text/javascript" src="{staticurl|urlescape}mercurial.js"></script>
--- a/mercurial/templates/monoblue/help.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/help.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Branches</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / help</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,14 +18,14 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
 	    <li class="current">help</li>
         </ul>
     </div>
--- a/mercurial/templates/monoblue/helptopics.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/helptopics.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Branches</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / help</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,14 +18,14 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}help{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
 	    <li class="current">help</li>
         </ul>
     </div>
--- a/mercurial/templates/monoblue/index.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/index.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -26,7 +26,7 @@
     </div>
 
     <div id="powered-by">
-        <p><a href="{logourl}" title="Mercurial"><img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a></p>
+        <p><a href="{logourl}" title="Mercurial"><img src="{staticurl|urlescape}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a></p>
     </div>
 
     <div id="corner-top-left"></div>
--- a/mercurial/templates/monoblue/manifest.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/manifest.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
 <title>{repo|escape}: files</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / files</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,20 +18,20 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
             <li class="current">files</li>
-	    <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+	    <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
     <ul class="submenu">
-        <li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> {archives%archiveentry}</li>
+        <li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> {archives%archiveentry}</li>
         {archives%archiveentry}
     </ul>
 
@@ -43,7 +43,7 @@
             <td>drwxr-xr-x</td>
             <td></td>
             <td></td>
-            <td><a href="{url}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td>
+            <td><a href="{url|urlescape}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td>
             <td class="link">&nbsp;</td>
         </tr>
         {dentries%direntry}
--- a/mercurial/templates/monoblue/map	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/map	Fri Feb 01 15:48:33 2013 -0600
@@ -11,35 +11,35 @@
 help = help.tmpl
 helptopics = helptopics.tmpl
 
-helpentry = '<tr><td><a href="{url}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
+helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
 
-naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navgraphentry = '<a href="{url}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a>'
-filedifflink = '<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navgraphentry = '<a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+filenaventry = '<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a>'
+filedifflink = '<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
 filenodelink = '
   <tr class="parity{parity}">
-    <td><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
+    <td><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
     <td></td>
     <td>
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
-      <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-      <a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a> |
+      <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+      <a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
+      <a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
     </td>
   </tr>'
 filenolink = '
   <tr class="parity{parity}">
-    <td><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
+    <td><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a></td>
     <td></td>
     <td>
       file |
       annotate |
-      <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
-      <a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+      <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
+      <a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a> |
+      <a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
     </td>
   </tr>'
 
@@ -58,19 +58,19 @@
     <td>drwxr-xr-x</td>
     <td></td>
     <td></td>
-    <td><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}</a></td>
-    <td><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></td>
+    <td><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a></td>
   </tr>'
 fileentry = '
   <tr class="parity{parity}">
     <td>{permissions|permissions}</td>
     <td>{date|isodate}</td>
     <td>{size}</td>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a></td>
     <td>
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
-      <a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a> |
+      <a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a> |
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
     </td>
   </tr>'
 filerevision = filerevision.tmpl
@@ -85,7 +85,7 @@
 annotateline = '
   <tr class="parity{parity}">
     <td class="linenr">
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
 	 title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
     </td>
     <td class="lineno">
@@ -112,136 +112,136 @@
   <tr>
     <th class="parent">parent {rev}:</th>
     <td class="parent">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
     </td>
   </tr>'
-changesetbranch = '<dt>branch</dt><dd>{name}</dd>'
+changesetbranch = '<dt>branch</dt><dd>{name|escape}</dd>'
 changesetparent = '
   <dt>parent {rev}</dt>
-  <dd><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>'
-filerevbranch = '<dt>branch</dt><dd>{name}</dd>'
+  <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>'
+filerevbranch = '<dt>branch</dt><dd>{name|escape}</dd>'
 filerevparent = '
   <dt>parent {rev}</dt>
   <dd>
-    <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+    <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
       {rename%filerename}{node|short}
     </a>
   </dd>'
 filerename = '{file|escape}@'
-filelogrename = '| <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">base</a>'
+filelogrename = '| <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">base</a>'
 fileannotateparent = '
   <dt>parent {rev}</dt>
   <dd>
-    <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+    <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
       {rename%filerename}{node|short}
     </a>
   </dd>'
 changelogchild = '
   <dt>child {rev}:</dt>
-  <dd><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>'
+  <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>'
 changesetchild = '
   <dt>child {rev}</dt>
-  <dd><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>'
+  <dd><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></dd>'
 filerevchild = '
   <dt>child {rev}</dt>
   <dd>
-    <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
+    <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
   </dd>'
 fileannotatechild = '
   <dt>child {rev}</dt>
   <dd>
-    <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
+    <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
   </dd>'
 tags = tags.tmpl
 tagentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
-    <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{tag|escape}</a></td>
+    <td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{tag|escape}</a></td>
     <td class="nowrap">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-      <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
-      <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+      <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
+      <a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 bookmarks = bookmarks.tmpl
 bookmarkentry = '
   <tr class="parity{parity}">
     <td class="nowrap date">{date|rfc822date}</td>
-    <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{bookmark|escape}</a></td>
+    <td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{bookmark|escape}</a></td>
     <td class="nowrap">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-      <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
-      <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+      <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
+      <a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 branches = branches.tmpl
 branchentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
-    <td><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
     <td class="{status}">{branch|escape}</td>
     <td class="nowrap">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-      <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
-      <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+      <a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">changelog</a> |
+      <a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 diffblock = '<pre>{lines}</pre>'
 filediffparent = '
   <dt>parent {rev}</dt>
-  <dd><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></dd>'
+  <dd><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></dd>'
 filecompparent = '
   <dt>parent {rev}</dt>
-  <dd><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></dd>'
+  <dd><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></dd>'
 filelogparent = '
   <tr>
     <td align="right">parent {rev}:&nbsp;</td>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filediffchild = '
   <dt>child {rev}</dt>
-  <dd><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></dd>'
+  <dd><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></dd>'
 filecompchild = '
   <dt>child {rev}</dt>
-  <dd><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></dd>'
+  <dd><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></dd>'
 filelogchild = '
   <tr>
     <td align="right">child {rev}:&nbsp;</td>
-    <td><a href="{url}file{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 shortlog = shortlog.tmpl
-tagtag = '<span class="tagtag" title="{name}">{name}</span> '
-branchtag = '<span class="branchtag" title="{name}">{name}</span> '
-inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> '
-bookmarktag = '<span class="bookmarktag" title="{name}">{name}</span> '
+tagtag = '<span class="tagtag" title="{name|escape}">{name|escape}</span> '
+branchtag = '<span class="branchtag" title="{name|escape}">{name|escape}</span> '
+inbranchtag = '<span class="inbranchtag" title="{name|escape}">{name|escape}</span> '
+bookmarktag = '<span class="bookmarktag" title="{name|escape}">{name|escape}</span> '
 shortlogentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
     <td>{author|person}</td>
     <td>
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         {desc|strip|firstline|escape|nonempty}
         <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}{bookmarks%bookmarktag}</span>
       </a>
     </td>
     <td class="nowrap">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
-      <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a> |
+      <a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
     </td>
   </tr>'
 filelogentry = '
   <tr class="parity{parity}">
     <td class="nowrap age">{date|rfc822date}</td>
-    <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></td>
+    <td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></td>
     <td class="nowrap">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
       {rename%filelogrename}
     </td>
   </tr>'
-archiveentry = '<li><a href="{url}archive/{node|short}{extension}">{type|escape}</a></li>'
+archiveentry = '<li><a href="{url|urlescape}archive/{node|short}{extension}">{type|escape}</a></li>'
 indexentry = '
   <tr class="parity{parity}">
-    <td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td>
+    <td><a href="{url|urlescape}{sessionvars%urlparameter}">{name|escape}</a></td>
     <td>{description}</td>
     <td>{contact|obfuscate}</td>
     <td class="age">{lastchange|rfc822date}</td>
@@ -249,14 +249,14 @@
     <td>
         {if(isdirectory, '',
             '<div class="rss_logo">
-                <a href="{url}rss-log">RSS</a> <a href="{url}atom-log">Atom</a>
+                <a href="{url|urlescape}rss-log">RSS</a> <a href="{url|urlescape}atom-log">Atom</a>
             </div>'
             )}
     </td>
   </tr>\n'
-indexarchiveentry = '<a href="{url}archive/{node|short}{extension}">{type|escape}</a> '
+indexarchiveentry = '<a href="{url|urlescape}archive/{node|short}{extension}">{type|escape}</a> '
 index = index.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
 graph = graph.tmpl
-breadcrumb = '&gt; <a href="{url}">{name}</a> '
+breadcrumb = '&gt; <a href="{url|urlescape}">{name|escape}</a> '
--- a/mercurial/templates/monoblue/notfound.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/notfound.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Mercurial repository not found</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / not found: {repo|escape}</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -19,19 +19,19 @@
 
         <ul class="page-nav">
             <li class="current">summary</li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}</li>
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}</li>
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
     <h2 class="no-link no-border">Not Found</h2>
     <p class="normal">The specified repository "{repo|escape}" is unknown, sorry.</p>
-    <p class="normal">Please go back to the <a href="{url}">main repository list page</a>.</p>
+    <p class="normal">Please go back to the <a href="{url|urlescape}">main repository list page</a>.</p>
 
 {footer}
--- a/mercurial/templates/monoblue/search.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/search.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Search</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / search</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,15 +18,15 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}
-            <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>{archives%archiveentry}
+            <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
--- a/mercurial/templates/monoblue/shortlog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/shortlog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: shortlog</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / shortlog</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,16 +18,16 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
             <li class="current">shortlog</li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
 	    {archives%archiveentry}
-	    <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+	    <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
--- a/mercurial/templates/monoblue/summary.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/summary.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Summary</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / summary</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -19,14 +19,14 @@
 
         <ul class="page-nav">
             <li class="current">summary</li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}log{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-            <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
-	    <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+	    <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
@@ -42,27 +42,27 @@
         <dd>{lastchange|rfc822date}</dd>
     </dl>
 
-    <h2><a href="{url}shortlog{sessionvars%urlparameter}">Changes</a></h2>
+    <h2><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">Changes</a></h2>
     <table>
 {shortlog}
         <tr class="light">
-            <td colspan="4"><a class="list" href="{url}shortlog{sessionvars%urlparameter}">...</a></td>
+            <td colspan="4"><a class="list" href="{url|urlescape}shortlog{sessionvars%urlparameter}">...</a></td>
         </tr>
     </table>
 
-    <h2><a href="{url}tags{sessionvars%urlparameter}">Tags</a></h2>
+    <h2><a href="{url|urlescape}tags{sessionvars%urlparameter}">Tags</a></h2>
     <table>
 {tags}
         <tr class="light">
-            <td colspan="3"><a class="list" href="{url}tags{sessionvars%urlparameter}">...</a></td>
+            <td colspan="3"><a class="list" href="{url|urlescape}tags{sessionvars%urlparameter}">...</a></td>
         </tr>
     </table>
 
-    <h2><a href="{url}bookmarks{sessionvars%urlparameter}">Bookmarks</a></h2>
+    <h2><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">Bookmarks</a></h2>
     <table>
     {bookmarks%bookmarkentry}
         <tr class="light">
-            <td colspan="3"><a class="list" href="{url}bookmarks{sessionvars%urlparameter}">...</a></td>
+            <td colspan="3"><a class="list" href="{url|urlescape}bookmarks{sessionvars%urlparameter}">...</a></td>
         </tr>
     </table>
 
--- a/mercurial/templates/monoblue/tags.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/monoblue/tags.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 {header}
     <title>{repo|escape}: Tags</title>
-    <link rel="alternate" type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}"/>
-    <link rel="alternate" type="application/rss+xml" href="{url}rss-log" title="RSS feed for {repo|escape}"/>
+    <link rel="alternate" type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
+    <link rel="alternate" type="application/rss+xml" href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 
 <body>
@@ -9,7 +9,7 @@
     <div class="page-header">
         <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / tags</h1>
 
-        <form action="{url}log">
+        <form action="{url|urlescape}log">
             {sessionvars%hiddenformentry}
             <dl class="search">
                 <dt><label>Search: </label></dt>
@@ -18,15 +18,15 @@
         </form>
 
         <ul class="page-nav">
-            <li><a href="{url}summary{sessionvars%urlparameter}">summary</a></li>
-            <li><a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a></li>
-            <li><a href="{url}changelog{sessionvars%urlparameter}">changelog</a></li>
-            <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+            <li><a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a></li>
+            <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a></li>
+            <li><a href="{url|urlescape}changelog{sessionvars%urlparameter}">changelog</a></li>
+            <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
             <li class="current">tags</li>
-            <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-            <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-            <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a></li>
-	    <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+            <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+            <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+            <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a></li>
+	    <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
         </ul>
     </div>
 
--- a/mercurial/templates/paper/bookmarks.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/bookmarks.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: bookmarks</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-bookmarks" title="Atom feed for {repo|escape}: bookmarks" />
+   href="{url|urlescape}atom-bookmarks" title="Atom feed for {repo|escape}: bookmarks" />
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-bookmarks" title="RSS feed for {repo|escape}: bookmarks" />
+   href="{url|urlescape}rss-bookmarks" title="RSS feed for {repo|escape}: bookmarks" />
 </head>
 <body>
 
@@ -11,22 +11,22 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
 <li class="active">bookmarks</li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 <p>
 <div class="atom-logo">
-<a href="{url}atom-bookmarks" title="subscribe to atom feed">
-<img class="atom-logo" src="{staticurl}feed-icon-14x14.png" alt="atom feed">
+<a href="{url|urlescape}atom-bookmarks" title="subscribe to atom feed">
+<img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed">
 </a>
 </div>
 </div>
@@ -35,7 +35,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>bookmarks</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/paper/branches.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/branches.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: branches</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-branches" title="Atom feed for {repo|escape}: branches" />
+   href="{url|urlescape}atom-branches" title="Atom feed for {repo|escape}: branches" />
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-branches" title="RSS feed for {repo|escape}: branches" />
+   href="{url|urlescape}rss-branches" title="RSS feed for {repo|escape}: branches" />
 </head>
 <body>
 
@@ -11,22 +11,22 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
 <li class="active">branches</li>
 </ul>
 <ul>
- <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+ <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 <p>
 <div class="atom-logo">
-<a href="{url}atom-branches" title="subscribe to atom feed">
-<img class="atom-logo" src="{staticurl}feed-icon-14x14.png" alt="atom feed">
+<a href="{url|urlescape}atom-branches" title="subscribe to atom feed">
+<img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed">
 </a>
 </div>
 </div>
@@ -35,7 +35,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>branches</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
@@ -50,7 +50,7 @@
 {entries %
 ' <tr class="tagEntry parity{parity}">
     <td>
-      <a href="{url}shortlog/{node|short}{sessionvars%urlparameter}" class="{status}">
+      <a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}" class="{status}">
         {branch|escape}
       </a>
     </td>
--- a/mercurial/templates/paper/changeset.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/changeset.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -6,25 +6,25 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
- <li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
- <li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
- <li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
- <li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
- <li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+ <li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
+ <li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+ <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+ <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+ <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
  <li class="active">changeset</li>
- <li><a href="{url}raw-rev/{node|short}{sessionvars%urlparameter}">raw</a></li>
- <li><a href="{url}file/{node|short}{sessionvars%urlparameter}">browse</a></li>
+ <li><a href="{url|urlescape}raw-rev/{node|short}{sessionvars%urlparameter}">raw</a></li>
+ <li><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">browse</a></li>
 </ul>
 <ul>
  {archives%archiveentry}
 </ul>
 <ul>
- <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+ <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -33,7 +33,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>changeset {rev}:{node|short} {changesetbranch%changelogbranchname} {changesettag} {changesetbookmark}</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
@@ -74,14 +74,6 @@
     </div>
   </td>
 </tr>
-<tr>
- <th class="author">change baseline</th>
- <td class="author">{parent%changesetbaseline}</td>
-</tr>
-<tr>
- <th class="author">current baseline</th>
- <td class="author"><a href="{url}rev/{currentbaseline|short}{sessionvars%urlparameter}">{currentbaseline|short}</a></td>
-</tr>
 </table>
 
 <div class="overflow">
--- a/mercurial/templates/paper/error.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/error.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,17 +7,17 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" width=75 height=90 border=0 alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -26,7 +26,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>error</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30"></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/paper/fileannotate.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/fileannotate.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,31 +7,31 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 
 <ul>
-<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
-<li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
+<li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
+<li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
 </ul>
 <ul>
-<li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
-<li><a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
-<li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
-<li><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
+<li><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
+<li><a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
+<li><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+<li><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
 <li class="active">annotate</li>
-<li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
-<li><a href="{url}raw-annotate/{node|short}/{file|urlescape}">raw</a></li>
+<li><a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
+<li><a href="{url|urlescape}raw-annotate/{node|short}/{file|urlescape}">raw</a></li>
 </ul>
 <ul>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -39,7 +39,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>annotate {file|escape} @ {rev}:{node|short}</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/paper/filecomparison.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/filecomparison.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,30 +7,30 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
-<li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
+<li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
+<li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
 </ul>
 <ul>
-<li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
-<li><a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
-<li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+<li><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
+<li><a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
+<li><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
 <li class="active">comparison</li>
-<li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
-<li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
-<li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
+<li><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
+<li><a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
+<li><a href="{url|urlescape}raw-file/{node|short}/{file|urlescape}">raw</a></li>
 </ul>
 <ul>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -38,7 +38,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>comparison {file|escape} @ {rev}:{node|short}</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 <p>{sessionvars%hiddenformentry}</p>
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/paper/filediff.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/filediff.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,30 +7,30 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
-<li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
+<li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
+<li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
 </ul>
 <ul>
-<li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
-<li><a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
+<li><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
+<li><a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
 <li class="active">diff</li>
-<li><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
-<li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
-<li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
-<li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
+<li><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
+<li><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
+<li><a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
+<li><a href="{url|urlescape}raw-file/{node|short}/{file|urlescape}">raw</a></li>
 </ul>
 <ul>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -38,7 +38,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>diff {file|escape} @ {rev}:{node|short}</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 <p>{sessionvars%hiddenformentry}</p>
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/paper/filelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/filelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: {file|escape} history</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}" />
+   href="{url|urlescape}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}" />
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log/tip/{file|urlescape}" title="RSS feed for {repo|escape}:{file}" />
+   href="{url|urlescape}rss-log/tip/{file|urlescape}" title="RSS feed for {repo|escape}:{file}" />
 </head>
 <body>
 
@@ -11,34 +11,34 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
-<li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
+<li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
+<li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
 </ul>
 <ul>
-<li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
-<li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
-<li><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
-<li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
+<li><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
+<li><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+<li><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
+<li><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
 <li class="active">file log</li>
-<li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
+<li><a href="{url|urlescape}raw-file/{node|short}/{file|urlescape}">raw</a></li>
 </ul>
 <ul>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 <p>
 <div class="atom-logo">
-<a href="{url}atom-log/{node|short}/{file|urlescape}" title="subscribe to atom feed">
-<img class="atom-logo" src="{staticurl}feed-icon-14x14.png" alt="atom feed"></a>
+<a href="{url|urlescape}atom-log/{node|short}/{file|urlescape}" title="subscribe to atom feed">
+<img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed"></a>
 </div>
 </div>
 
@@ -46,7 +46,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>log {file|escape}</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
@@ -54,8 +54,8 @@
 </form>
 
 <div class="navigate">
-<a href="{url}log/{node|short}/{file|urlescape}{lessvars%urlparameter}">less</a>
-<a href="{url}log/{node|short}/{file|urlescape}{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{morevars%urlparameter}">more</a>
 | {nav%filenav}</div>
 
 <table class="bigtable">
@@ -68,8 +68,8 @@
 </table>
 
 <div class="navigate">
-<a href="{url}log/{node|short}/{file|urlescape}{lessvars%urlparameter}">less</a>
-<a href="{url}log/{node|short}/{file|urlescape}{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{morevars%urlparameter}">more</a>
 | {nav%filenav}
 </div>
 
--- a/mercurial/templates/paper/filelogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/filelogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,5 +1,5 @@
  <tr class="parity{parity}">
   <td class="age">{date|rfc822date}</td>
   <td class="author">{author|person}</td>
-  <td class="description"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{rename%filelogrename}</td>
+  <td class="description"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags%changelogtag}{rename%filelogrename}</td>
  </tr>
--- a/mercurial/templates/paper/filerevision.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/filerevision.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,29 +7,29 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
-<li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
+<li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
+<li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
 </ul>
 <ul>
 <li class="active">file</li>
-<li><a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
-<li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
-<li><a href="{url}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
-<li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
-<li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
-<li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
+<li><a href="{url|urlescape}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
+<li><a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+<li><a href="{url|urlescape}comparison/{node|short}/{file|urlescape}{sessionvars%urlparameter}">comparison</a></li>
+<li><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
+<li><a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
+<li><a href="{url|urlescape}raw-file/{node|short}/{file|urlescape}">raw</a></li>
 </ul>
 <ul>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -37,7 +37,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>view {file|escape} @ {rev}:{node|short}</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/paper/graph.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/graph.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,10 +1,10 @@
 {header}
 <title>{repo|escape}: revision graph</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}: log" />
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}: log" />
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}: log" />
-<!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}: log" />
+<!--[if IE]><script type="text/javascript" src="{staticurl|urlescape}excanvas.js"></script><![endif]-->
 </head>
 <body>
 
@@ -12,26 +12,26 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
 <li class="active">graph</li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
-<li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
+<li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
+<li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
 </ul>
 <ul>
- <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+ <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 <p>
 <div class="atom-logo">
-<a href="{url}atom-log" title="subscribe to atom feed">
-<img class="atom-logo" src="{staticurl}feed-icon-14x14.png" alt="atom feed">
+<a href="{url|urlescape}atom-log" title="subscribe to atom feed">
+<img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed">
 </a>
 </div>
 </div>
@@ -40,7 +40,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>graph</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
@@ -48,8 +48,8 @@
 </form>
 
 <div class="navigate">
-<a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
-<a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
 | rev {rev}: {changenav%navgraph}
 </div>
 
@@ -105,7 +105,7 @@
 	}
 
 	var item = '<li style="' + nstyle + '"><span class="desc">';
-	item += '<a href="{url}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>';
+	item += '<a href="{url|urlescape}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>';
 	item += '</span>' + tagspan + '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
 	
 	return [bg, item];
@@ -118,8 +118,8 @@
 </script>
 
 <div class="navigate">
-<a href="{url}graph/{rev}{lessvars%urlparameter}">less</a>
-<a href="{url}graph/{rev}{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}graph/{rev}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}graph/{rev}{morevars%urlparameter}">more</a>
 | rev {rev}: {changenav%navgraph}
 </div>
 
--- a/mercurial/templates/paper/header.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/header.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
 <head>
-<link rel="icon" href="{staticurl}hgicon.png" type="image/png" />
+<link rel="icon" href="{staticurl|urlescape}hgicon.png" type="image/png" />
 <meta name="robots" content="index, nofollow" />
-<link rel="stylesheet" href="{staticurl}style-paper.css" type="text/css" />
-<script type="text/javascript" src="{staticurl}mercurial.js"></script>
+<link rel="stylesheet" href="{staticurl|urlescape}style-paper.css" type="text/css" />
+<script type="text/javascript" src="{staticurl|urlescape}mercurial.js"></script>
--- a/mercurial/templates/paper/help.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/help.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,17 +7,17 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
- <li class="active"><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+ <li class="active"><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -25,7 +25,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>Help: {topic}</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/paper/helptopics.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/helptopics.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,14 +7,14 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
 <li class="active">help</li>
@@ -23,7 +23,7 @@
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/paper/index.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/index.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -6,7 +6,7 @@
 <div class="container">
 <div class="menu">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" width=75 height=90 border=0 alt="mercurial" /></a>
 </div>
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
--- a/mercurial/templates/paper/manifest.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/manifest.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,24 +7,24 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
+<li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
 <li class="active">browse</li>
 </ul>
 <ul>
 {archives%archiveentry}
 </ul>
 <ul>
- <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+ <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -32,7 +32,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>directory {path|escape} @ {rev}:{node|short} {tags%changelogtag}</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
@@ -46,7 +46,7 @@
   <th class="permissions">permissions</th>
 </tr>
 <tr class="fileline parity{upparity}">
-  <td class="name"><a href="{url}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td>
+  <td class="name"><a href="{url|urlescape}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a></td>
   <td class="size"></td>
   <td class="permissions">drwxr-xr-x</td>
 </tr>
--- a/mercurial/templates/paper/map	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/map	Fri Feb 01 15:48:33 2013 -0600
@@ -12,14 +12,14 @@
 help = help.tmpl
 helptopics = helptopics.tmpl
 
-helpentry = '<tr><td><a href="{url}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
+helpentry = '<tr><td><a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">{topic|escape}</a></td><td>{summary|escape}</td></tr>'
 
-naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navgraphentry = '<a href="{url}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
-filedifflink = '<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
-filenodelink = '<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navgraphentry = '<a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+filenaventry = '<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
+filedifflink = '<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+filenodelink = '<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
 filenolink = '{file|escape} '
 fileellipses = '...'
 diffstatlink = diffstat.tmpl
@@ -37,10 +37,10 @@
 direntry = '
   <tr class="fileline parity{parity}">
     <td class="name">
-      <a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">
-        <img src="{staticurl}coal-folder.png" alt="dir."/> {basename|escape}/
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">
+        <img src="{staticurl|urlescape}coal-folder.png" alt="dir."/> {basename|escape}/
       </a>
-      <a href="{url}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">
         {emptydirs|escape}
       </a>
     </td>
@@ -51,8 +51,8 @@
 fileentry = '
   <tr class="fileline parity{parity}">
     <td class="filename">
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
-        <img src="{staticurl}coal-file.png" alt="file"/> {basename|escape}
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+        <img src="{staticurl|urlescape}coal-file.png" alt="file"/> {basename|escape}
       </a>
     </td>
     <td class="size">{size}</td>
@@ -71,7 +71,7 @@
 annotateline = '
   <tr class="parity{parity}">
     <td class="annotate">
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
          title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
     </td>
     <td class="source"><a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}</td>
@@ -96,21 +96,21 @@
 changelogparent = '
   <tr>
     <th class="parent">parent {rev}:</th>
-    <td class="parent"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="parent"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 
-changesetparent = '<a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a> '
+changesetparent = '<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a> '
 
-changesetbaseline = '<a href="{url}rev/{node|short}:{originalnode|short}{sessionvars%urlparameter}">{node|short}</a> '
+difffrom = '<a href="{url|urlescape}rev/{node|short}:{originalnode|short}{sessionvars%urlparameter}">{node|short}</a> '
 
-filerevparent = '<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a> '
-filerevchild = '<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a> '
+filerevparent = '<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a> '
+filerevchild = '<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a> '
 
 filerename = '{file|escape}@'
 filelogrename = '
   <span class="base">
     base
-    <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+    <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
       {file|escape}@{node|short}
     </a>
   </span>'
@@ -118,17 +118,17 @@
   <tr>
     <td class="metatag">parent:</td>
     <td>
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {rename%filerename}{node|short}
       </a>
     </td>
   </tr>'
-changesetchild = ' <a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>'
+changesetchild = ' <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>'
 changelogchild = '
   <tr>
     <th class="child">child</th>
     <td class="child">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         {node|short}
       </a>
     </td>
@@ -137,7 +137,7 @@
   <tr>
     <td class="metatag">child:</td>
     <td>
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {node|short}
       </a>
     </td>
@@ -146,7 +146,7 @@
 tagentry = '
   <tr class="tagEntry parity{parity}">
     <td>
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         {tag|escape}
       </a>
     </td>
@@ -158,7 +158,7 @@
 bookmarkentry = '
   <tr class="tagEntry parity{parity}">
     <td>
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
         {bookmark|escape}
       </a>
     </td>
@@ -170,7 +170,7 @@
 branchentry = '
   <tr class="tagEntry parity{parity}">
     <td>
-      <a href="{url}shortlog/{node|short}{sessionvars%urlparameter}" class="{status}">
+      <a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}" class="{status}">
         {branch|escape}
       </a>
     </td>
@@ -187,48 +187,48 @@
 filediffparent = '
   <tr>
     <th class="parent">parent {rev}:</th>
-    <td class="parent"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="parent"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filelogparent = '
   <tr>
     <th>parent {rev}:</th>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filediffchild = '
   <tr>
     <th class="child">child {rev}:</th>
-    <td class="child"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+    <td class="child"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
   </td>
   </tr>'
 filelogchild = '
   <tr>
     <th>child {rev}:</th>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 
 indexentry = '
   <tr class="parity{parity}">
-    <td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td>
+    <td><a href="{url|urlescape}{sessionvars%urlparameter}">{name|escape}</a></td>
     <td>{description}</td>
     <td>{contact|obfuscate}</td>
     <td class="age">{lastchange|rfc822date}</td>
     <td class="indexlinks">{archives%indexarchiveentry}</td>
     <td>
         {if(isdirectory, '',
-            '<a href="{url}atom-log" title="subscribe to repository atom feed">
-                <img class="atom-logo" src="{staticurl}feed-icon-14x14.png" alt="subscribe to repository atom feed">
+            '<a href="{url|urlescape}atom-log" title="subscribe to repository atom feed">
+                <img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="subscribe to repository atom feed">
             </a>'
             )}
     </td>
   </tr>\n'
-indexarchiveentry = '<a href="{url}archive/{node|short}{extension|urlescape}">&nbsp;&darr;{type|escape}</a>'
+indexarchiveentry = '<a href="{url|urlescape}archive/{node|short}{extension|urlescape}">&nbsp;&darr;{type|escape}</a>'
 index = index.tmpl
 archiveentry = '
   <li>
-    <a href="{url}archive/{node|short}{extension|urlescape}">{type|escape}</a>
+    <a href="{url|urlescape}archive/{node|short}{extension|urlescape}">{type|escape}</a>
   </li>'
 notfound = notfound.tmpl
 error = error.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
-breadcrumb = '&gt; <a href="{url}">{name}</a> '
+breadcrumb = '&gt; <a href="{url|urlescape}">{name|escape}</a> '
--- a/mercurial/templates/paper/notfound.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/notfound.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,6 +7,6 @@
 
 The specified repository "{repo|escape}" is unknown, sorry.
 
-Please go back to the <a href="{url}">main repository list page</a>.
+Please go back to the <a href="{url|urlescape}">main repository list page</a>.
 
 {footer}
--- a/mercurial/templates/paper/search.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/search.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,15 +7,15 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a>
+<img src="{staticurl|urlescape}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a>
 </div>
 <ul>
-<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 </div>
 
@@ -23,7 +23,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>searching for '{query|escape}'</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30"></p>
 <div id="hint">find changesets by author, revision,
@@ -31,8 +31,8 @@
 </form>
 
 <div class="navigate">
-<a href="{url}search/{lessvars%urlparameter}">less</a>
-<a href="{url}search/{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}search/{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}search/{morevars%urlparameter}">more</a>
 </div>
 
 <table class="bigtable">
@@ -45,8 +45,8 @@
 </table>
 
 <div class="navigate">
-<a href="{url}search/{lessvars%urlparameter}">less</a>
-<a href="{url}search/{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}search/{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}search/{morevars%urlparameter}">more</a>
 </div>
 
 </div>
--- a/mercurial/templates/paper/shortlog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/shortlog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: log</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}" />
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}" />
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}" />
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}" />
 </head>
 <body>
 
@@ -11,29 +11,29 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
 <li class="active">log</li>
-<li><a href="{url}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
-<li><a href="{url}tags{sessionvars%urlparameter}">tags</a></li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
-<li><a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
+<li><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a></li>
+<li><a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">browse</a></li>
 </ul>
 <ul>
 {archives%archiveentry}
 </ul>
 <ul>
- <li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+ <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 <p>
 <div class="atom-logo">
-<a href="{url}atom-log" title="subscribe to atom feed">
-<img class="atom-logo" src="{staticurl}feed-icon-14x14.png" alt="atom feed">
+<a href="{url|urlescape}atom-log" title="subscribe to atom feed">
+<img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed">
 </a>
 </div>
 </div>
@@ -42,7 +42,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>log</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
@@ -50,8 +50,8 @@
 </form>
 
 <div class="navigate">
-<a href="{url}shortlog/{rev}{lessvars%urlparameter}">less</a>
-<a href="{url}shortlog/{rev}{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}shortlog/{rev}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}shortlog/{rev}{morevars%urlparameter}">more</a>
 | rev {rev}: {changenav%navshort}
 </div>
 
@@ -65,8 +65,8 @@
 </table>
 
 <div class="navigate">
-<a href="{url}shortlog/{rev}{lessvars%urlparameter}">less</a>
-<a href="{url}shortlog/{rev}{morevars%urlparameter}">more</a>
+<a href="{url|urlescape}shortlog/{rev}{lessvars%urlparameter}">less</a>
+<a href="{url|urlescape}shortlog/{rev}{morevars%urlparameter}">more</a>
 | rev {rev}: {changenav%navshort}
 </div>
 
--- a/mercurial/templates/paper/shortlogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/shortlogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,5 +1,5 @@
  <tr class="parity{parity}">
   <td class="age">{date|rfc822date}</td>
   <td class="author">{author|person}</td>
-  <td class="description"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags % '<span class="tag">{name|escape}</span> '}{bookmarks % '<span class="tag">{name|escape}</span> '}</td>
+  <td class="description"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a>{inbranch%changelogbranchname}{branches%changelogbranchhead}{tags % '<span class="tag">{name|escape}</span> '}{bookmarks % '<span class="tag">{name|escape}</span> '}</td>
  </tr>
--- a/mercurial/templates/paper/tags.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/paper/tags.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,9 +1,9 @@
 {header}
 <title>{repo|escape}: tags</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-tags" title="Atom feed for {repo|escape}: tags" />
+   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}: tags" />
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-tags" title="RSS feed for {repo|escape}: tags" />
+   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}: tags" />
 </head>
 <body>
 
@@ -11,22 +11,22 @@
 <div class="menu">
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" alt="mercurial" /></a>
+<img src="{staticurl|urlescape}{logoimg}" alt="mercurial" /></a>
 </div>
 <ul>
-<li><a href="{url}shortlog{sessionvars%urlparameter}">log</a></li>
-<li><a href="{url}graph{sessionvars%urlparameter}">graph</a></li>
+<li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
+<li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
 <li class="active">tags</li>
-<li><a href="{url}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
-<li><a href="{url}branches{sessionvars%urlparameter}">branches</a></li>
+<li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
+<li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li><a href="{url}help{sessionvars%urlparameter}">help</a></li>
+<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 <p>
 <div class="atom-logo">
-<a href="{url}atom-tags" title="subscribe to atom feed">
-<img class="atom-logo" src="{staticurl}feed-icon-14x14.png" alt="atom feed"></a>
+<a href="{url|urlescape}atom-tags" title="subscribe to atom feed">
+<img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed"></a>
 </div>
 </div>
 
@@ -34,7 +34,7 @@
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>tags</h3>
 
-<form class="search" action="{url}log">
+<form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">find changesets by author, revision,
--- a/mercurial/templates/rss/bookmarkentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/rss/bookmarkentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,6 +1,6 @@
 <item>
     <title>{bookmark|escape}</title>
-    <link>{urlbase}{url}rev/{node|short}</link>
+    <link>{urlbase}{url|urlescape}rev/{node|short}</link>
     <description><![CDATA[{bookmark|strip|escape|addbreaks}]]></description>
     <pubDate>{date|rfc822date}</pubDate>
 </item>
--- a/mercurial/templates/rss/branchentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/rss/branchentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,6 +1,6 @@
 <item>
     <title>{branch|escape}</title>
-    <link>{urlbase}{url}rev/{node|short}</link>
+    <link>{urlbase}{url|urlescape}rev/{node|short}</link>
     <description><![CDATA[{branch|strip|escape|addbreaks}]]></description>
     <pubDate>{date|rfc822date}</pubDate>
 </item>
--- a/mercurial/templates/rss/changelogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/rss/changelogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,6 +1,6 @@
 <item>
     <title>{desc|strip|firstline|strip|escape}</title>
-    <guid isPermaLink="true">{urlbase}{url}rev/{node|short}</guid>
+    <guid isPermaLink="true">{urlbase}{url|urlescape}rev/{node|short}</guid>
     <description><![CDATA[{desc|strip|escape|addbreaks|nonempty}]]></description>
     <author>{author|obfuscate}</author>
     <pubDate>{date|rfc822date}</pubDate>
--- a/mercurial/templates/rss/filelogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/rss/filelogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,6 +1,6 @@
 <item>
     <title>{desc|strip|firstline|strip|escape}</title>
-    <link>{urlbase}{url}log{node|short}/{file|urlescape}</link>
+    <link>{urlbase}{url|urlescape}log{node|short}/{file|urlescape}</link>
     <description><![CDATA[{desc|strip|escape|addbreaks|nonempty}]]></description>
     <author>{author|obfuscate}</author>
     <pubDate>{date|rfc822date}</pubDate>
--- a/mercurial/templates/rss/header.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/rss/header.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="{encoding}"?>
 <rss version="2.0">
   <channel>
-    <link>{urlbase}{url}</link>
+    <link>{urlbase}{url|urlescape}</link>
     <language>en-us</language>
--- a/mercurial/templates/rss/tagentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/rss/tagentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,6 +1,6 @@
 <item>
     <title>{tag|escape}</title>
-    <link>{urlbase}{url}rev/{node|short}</link>
+    <link>{urlbase}{url|urlescape}rev/{node|short}</link>
     <description><![CDATA[{tag|strip|escape|addbreaks}]]></description>
     <pubDate>{date|rfc822date}</pubDate>
 </item>
--- a/mercurial/templates/spartan/branches.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/branches.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,21 +1,21 @@
 {header}
 <title>{repo|escape}: branches</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-branches" title="Atom feed for {repo|escape}: branches">
+   href="{url|urlescape}atom-branches" title="Atom feed for {repo|escape}: branches">
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-branches" title="RSS feed for {repo|escape}: branches">
+   href="{url|urlescape}rss-branches" title="RSS feed for {repo|escape}: branches">
 </head>
 <body>
 
 <div class="buttons">
-<a href="{url}log{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}file/{node|short}/{sessionvars%urlparameter}">files</a>
-<a href="{url}help{sessionvars%urlparameter}">help</a>
-<a type="application/rss+xml" href="{url}rss-branches">rss</a>
-<a type="application/atom+xml" href="{url}atom-branches">atom</a>
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}file/{node|short}/{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
+<a type="application/rss+xml" href="{url|urlescape}rss-branches">rss</a>
+<a type="application/atom+xml" href="{url|urlescape}atom-branches">atom</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / branches</h2>
--- a/mercurial/templates/spartan/changelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/changelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,27 +1,27 @@
 {header}
 <title>{repo|escape}: changelog</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}">
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}">
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}">
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}">
 </head>
 <body>
 
 <div class="buttons">
-<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
 {archives%archiveentry}
-<a href="{url}help{sessionvars%urlparameter}">help</a>
-<a type="application/rss+xml" href="{url}rss-log">rss</a>
-<a type="application/atom+xml" href="{url}atom-log" title="Atom feed for {repo|escape}">atom</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
+<a type="application/rss+xml" href="{url|urlescape}rss-log">rss</a>
+<a type="application/atom+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}">atom</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / changelog</h2>
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p>
 <label for="search1">search:</label>
@@ -32,7 +32,7 @@
 
 {entries%changelogentry}
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p>
 <label for="search2">search:</label>
--- a/mercurial/templates/spartan/changelogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/changelogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -5,7 +5,7 @@
  </tr>
  <tr>
   <th class="revision">changeset {rev}:</th>
-  <td class="node"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+  <td class="node"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
  </tr>
  {parent%changelogparent}
  {child%changelogchild}
@@ -19,7 +19,7 @@
   <td class="date">{date|rfc822date}</td>
  </tr>
  <tr>
-  <th class="files"><a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>:</th>
+  <th class="files"><a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>:</th>
   <td class="files">{files}</td>
  </tr>
 </table>
--- a/mercurial/templates/spartan/changeset.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/changeset.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -4,15 +4,15 @@
 <body>
 
 <div class="buttons">
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
-<a href="{url}raw-rev/{node|short}">raw</a>
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}raw-rev/{node|short}">raw</a>
 {archives%archiveentry}
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset: {desc|strip|escape|firstline|nonempty}</h2>
@@ -20,7 +20,7 @@
 <table id="changesetEntry">
 <tr>
  <th class="changeset">changeset {rev}:</th>
- <td class="changeset"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+ <td class="changeset"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
 </tr>
 {parent%changesetparent}
 {child%changesetchild}
--- a/mercurial/templates/spartan/fileannotate.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/fileannotate.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -4,17 +4,17 @@
 <body>
 
 <div class="buttons">
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
-<a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
-<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
-<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
-<a href="{url}raw-annotate/{node|short}/{file|urlescape}">raw</a>
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
+<a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+<a href="{url|urlescape}raw-annotate/{node|short}/{file|urlescape}">raw</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / annotate {file|escape}</h2>
@@ -22,7 +22,7 @@
 <table>
 <tr>
  <td class="metatag">changeset {rev}:</td>
- <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
+ <td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
 {parent%fileannotateparent}
 {child%fileannotatechild}
 <tr>
--- a/mercurial/templates/spartan/filediff.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/filediff.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -4,17 +4,17 @@
 <body>
 
 <div class="buttons">
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
-<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
-<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
-<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
-<a href="{url}raw-diff/{node|short}/{file|urlescape}">raw</a>
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
+<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+<a href="{url|urlescape}raw-diff/{node|short}/{file|urlescape}">raw</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / {file|escape}</h2>
@@ -22,7 +22,7 @@
 <table id="filediffEntry">
 <tr>
  <th class="revision">revision {rev}:</th>
- <td class="revision"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+ <td class="revision"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
 </tr>
 {parent%filediffparent}
 {child%filediffchild}
--- a/mercurial/templates/spartan/filelog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/filelog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,23 +1,23 @@
 {header}
 <title>{repo|escape}: {file|escape} history</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}">
+   href="{url|urlescape}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}">
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log/tip/{file|urlescape}" title="RSS feed for {repo|escape}:{file}">
+   href="{url|urlescape}rss-log/tip/{file|urlescape}" title="RSS feed for {repo|escape}:{file}">
 </head>
 <body>
 
 <div class="buttons">
-<a href="{url}log{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
-<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
-<a href="{url}help{sessionvars%urlparameter}">help</a>
-<a type="application/rss+xml" href="{url}rss-log/tip/{file|urlescape}">rss</a>
-<a type="application/atom+xml" href="{url}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}">atom</a>
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a>
+<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
+<a type="application/rss+xml" href="{url|urlescape}rss-log/tip/{file|urlescape}">rss</a>
+<a type="application/atom+xml" href="{url|urlescape}atom-log/tip/{file|urlescape}" title="Atom feed for {repo|escape}:{file}">atom</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / {file|escape} revision history</h2>
--- a/mercurial/templates/spartan/filelogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/filelogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,14 +1,14 @@
 <table class="logEntry parity{parity}">
  <tr>
   <th><span class="age">{date|rfc822date}</span>:</th>
-  <th class="firstline"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></th>
+  <th class="firstline"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></th>
  </tr>
  <tr>
   <th class="revision">revision {filerev}:</td>
   <td class="node">
-   <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
-   <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">(diff)</a>
-   <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">(annotate)</a>
+   <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a>
+   <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">(diff)</a>
+   <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">(annotate)</a>
   </td>
  </tr>
  {rename%filelogrename}
--- a/mercurial/templates/spartan/filerevision.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/filerevision.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -4,17 +4,17 @@
 <body>
 
 <div class="buttons">
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
-<a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
-<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
-<a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
-<a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a>
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
+<a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">revisions</a>
+<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a>
+<a href="{url|urlescape}raw-file/{node|short}/{file|urlescape}">raw</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / {file|escape}</h2>
@@ -22,7 +22,7 @@
 <table>
 <tr>
  <td class="metatag">changeset {rev}:</td>
- <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
+ <td><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
 {parent%filerevparent}
 {child%filerevchild}
 <tr>
--- a/mercurial/templates/spartan/footer.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/footer.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -2,7 +2,7 @@
 {motd}
 <div class="logo">
 <a href="{logourl}">
-<img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a>
+<img src="{staticurl|urlescape}{logoimg}" width=75 height=90 border=0 alt="mercurial"></a>
 </div>
 
 </body>
--- a/mercurial/templates/spartan/graph.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/graph.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,25 +1,25 @@
 {header}
 <title>{repo|escape}: graph</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-tags" title="Atom feed for {repo|escape}: tags">
+   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}: tags">
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-tags" title="RSS feed for {repo|escape}: tags">
-<!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]-->
+   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}: tags">
+<!--[if IE]><script type="text/javascript" src="{staticurl|urlescape}excanvas.js"></script><![endif]-->
 </head>
 <body>
 
 <div class="buttons">
-<a href="{url}log{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}file/{node|short}/{sessionvars%urlparameter}">files</a>
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}file/{node|short}/{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / graph</h2>
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p>
 <label for="search1">search:</label>
@@ -54,7 +54,7 @@
 	var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
 	var nstyle = 'padding-left: ' + left + 'px;';
 	var item = '<li style="' + nstyle + '"><span class="desc">';
-	item += '<a href="{url}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>';
+	item += '<a href="{url|urlescape}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '">' + cur[3] + '</a>';
 	item += '</span><span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
 
 	return [bg, item];
@@ -66,7 +66,7 @@
 // stop hiding script -->
 </script>
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p>
 <label for="search1">search:</label>
--- a/mercurial/templates/spartan/header.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/header.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
-<link rel="icon" href="{staticurl}hgicon.png" type="image/png">
+<link rel="icon" href="{staticurl|urlescape}hgicon.png" type="image/png">
 <meta name="robots" content="index, nofollow" />
-<link rel="stylesheet" href="{staticurl}style.css" type="text/css" />
-<script type="text/javascript" src="{staticurl}mercurial.js"></script>
+<link rel="stylesheet" href="{staticurl|urlescape}style.css" type="text/css" />
+<script type="text/javascript" src="{staticurl|urlescape}mercurial.js"></script>
--- a/mercurial/templates/spartan/manifest.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/manifest.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -4,24 +4,24 @@
 <body>
 
 <div class="buttons">
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog/{rev}{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">changeset</a>
 {archives%archiveentry}
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
-<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / files for changeset <a href="{url}rev/{node|short}">{node|short}</a>: {path|escape}</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / files for changeset <a href="{url|urlescape}rev/{node|short}">{node|short}</a>: {path|escape}</h2>
 
 <table cellpadding="0" cellspacing="0">
 <tr class="parity{upparity}">
   <td><tt>drwxr-xr-x</tt>&nbsp;
   <td>&nbsp;
   <td>&nbsp;
-  <td><a href="{url}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a>
+  <td><a href="{url|urlescape}file/{node|short}{up|urlescape}{sessionvars%urlparameter}">[up]</a>
 </tr>
 {dentries%direntry}
 {fentries%fileentry}
--- a/mercurial/templates/spartan/map	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/map	Fri Feb 01 15:48:33 2013 -0600
@@ -7,12 +7,12 @@
 shortlog = shortlog.tmpl
 shortlogentry = shortlogentry.tmpl
 graph = graph.tmpl
-naventry = '<a href="{url}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navshortentry = '<a href="{url}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-navgraphentry = '<a href="{url}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
-filenaventry = '<a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
-filedifflink = '<a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
-filenodelink = '<a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+navgraphentry = '<a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
+filenaventry = '<a href="{url|urlescape}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{label|escape}</a> '
+filedifflink = '<a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
+filenodelink = '<a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{file|escape}</a> '
 filenolink = '{file|escape} '
 fileellipses = '...'
 changelogentry = changelogentry.tmpl
@@ -31,8 +31,8 @@
     <td>&nbsp;
     <td>&nbsp;
     <td>
-      <a href="{url}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}/</a>
-      <a href="{url}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}{sessionvars%urlparameter}">{basename|escape}/</a>
+      <a href="{url|urlescape}file/{node|short}{path|urlescape}/{emptydirs|urlescape}{sessionvars%urlparameter}">
         {emptydirs|urlescape}
       </a>'
 
@@ -41,7 +41,7 @@
     <td><tt>{permissions|permissions}</tt>&nbsp;
     <td align=right><tt class="date">{date|isodate}</tt>&nbsp;
     <td align=right><tt>{size}</tt>&nbsp;
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>'
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{basename|escape}</a>'
 
 filerevision = filerevision.tmpl
 fileannotate = fileannotate.tmpl
@@ -56,7 +56,7 @@
 annotateline = '
   <tr class="parity{parity}">
     <td class="annotate">
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
          title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
     </td>
     <td>
@@ -72,19 +72,19 @@
   <tr>
     <th class="parent">parent {rev}:</th>
     <td class="parent">
-      <a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+      <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
     </td>
   </tr>'
 changesetparent = '
   <tr>
     <th class="parent">parent {rev}:</th>
-    <td class="parent"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="parent"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filerevparent = '
   <tr>
     <td class="metatag">parent:</td>
     <td>
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {rename%filerename}{node|short}
       </a>
     </td>
@@ -94,7 +94,7 @@
   <tr>
     <th>base:</th>
     <td>
-      <a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {file|escape}@{node|short}
       </a>
     </td>
@@ -103,7 +103,7 @@
   <tr>
     <td class="metatag">parent:</td>
     <td>
-      <a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
+      <a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">
         {rename%filerename}{node|short}
       </a>
     </td>
@@ -111,34 +111,34 @@
 changesetchild = '
   <tr>
     <th class="child">child {rev}:</th>
-    <td class="child"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="child"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 changelogchild = '
   <tr>
     <th class="child">child {rev}:</th>
-    <td class="child"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="child"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filerevchild = '
   <tr>
     <td class="metatag">child:</td>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 fileannotatechild = '
   <tr>
     <td class="metatag">child:</td>
-    <td><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 tags = tags.tmpl
 tagentry = '
   <li class="tagEntry parity{parity}">
     <tt class="node">{node}</tt>
-    <a href="{url}rev/{node|short}{sessionvars%urlparameter}">{tag|escape}</a>
+    <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{tag|escape}</a>
   </li>'
 branches = branches.tmpl
 branchentry = '
   <li class="tagEntry parity{parity}">
     <tt class="node">{node}</tt>
-    <a href="{url}shortlog/{node|short}{sessionvars%urlparameter}" class="{status}">{branch|escape}</a>
+    <a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}" class="{status}">{branch|escape}</a>
   </li>'
 diffblock = '<pre class="parity{parity}">{lines}</pre>'
 changelogtag = '<tr><th class="tag">tag:</th><td class="tag">{tag|escape}</td></tr>'
@@ -146,39 +146,39 @@
 filediffparent = '
   <tr>
     <th class="parent">parent {rev}:</th>
-    <td class="parent"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="parent"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filelogparent = '
   <tr>
     <th>parent {rev}:</th>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filediffchild = '
   <tr>
     <th class="child">child {rev}:</th>
-    <td class="child"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td class="child"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 filelogchild = '
   <tr>
     <th>child {rev}:</th>
-    <td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
+    <td><a href="{url|urlescape}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td>
   </tr>'
 indexentry = '
   <tr class="parity{parity}">
-    <td><a href="{url}{sessionvars%urlparameter}">{name|escape}</a></td>
+    <td><a href="{url|urlescape}{sessionvars%urlparameter}">{name|escape}</a></td>
     <td>{description}</td>
     <td>{contact|obfuscate}</td>
     <td class="age">{lastchange|rfc822date}</td>
     <td class="indexlinks">
-      <a href="{url}rss-log">RSS</a>
-      <a href="{url}atom-log">Atom</a>
+      <a href="{url|urlescape}rss-log">RSS</a>
+      <a href="{url|urlescape}atom-log">Atom</a>
       {archives%archiveentry}
     </td>
   </tr>'
 index = index.tmpl
-archiveentry = '<a href="{url}archive/{node|short}{extension|urlescape}">{type|escape}</a> '
+archiveentry = '<a href="{url|urlescape}archive/{node|short}{extension|urlescape}">{type|escape}</a> '
 notfound = notfound.tmpl
 error = error.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
-breadcrumb = '&gt; <a href="{url}">{name}</a> '
+breadcrumb = '&gt; <a href="{url|urlescape}">{name|escape}</a> '
--- a/mercurial/templates/spartan/notfound.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/notfound.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -7,6 +7,6 @@
 
 The specified repository "{repo|escape}" is unknown, sorry.
 
-Please go back to the <a href="{url}">main repository list page</a>.
+Please go back to the <a href="{url|urlescape}">main repository list page</a>.
 
 {footer}
--- a/mercurial/templates/spartan/search.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/search.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -4,14 +4,14 @@
 <body>
 
 <div class="buttons">
-<a href="{url}log{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}file/{node|short}{sessionvars%urlparameter}">files</a>
 {archives%archiveentry}
-<a href="{url}help{sessionvars%urlparameter}">help</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
 </div>
 
 <h2>searching for {query|escape}</h2>
--- a/mercurial/templates/spartan/shortlog.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/shortlog.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,27 +1,27 @@
 {header}
 <title>{repo|escape}: shortlog</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-log" title="Atom feed for {repo|escape}">
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}">
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-log" title="RSS feed for {repo|escape}">
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}">
 </head>
 <body>
 
 <div class="buttons">
-<a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}tags{sessionvars%urlparameter}">tags</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}file/{node|short}/{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}log/{rev}{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}file/{node|short}/{sessionvars%urlparameter}">files</a>
 {archives%archiveentry}
-<a href="{url}help{sessionvars%urlparameter}">help</a>
-<a type="application/rss+xml" href="{url}rss-log">rss</a>
-<a type="application/rss+xml" href="{url}atom-log" title="Atom feed for {repo|escape}">atom</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
+<a type="application/rss+xml" href="{url|urlescape}rss-log">rss</a>
+<a type="application/rss+xml" href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}">atom</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / shortlog</h2>
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p>
 <label for="search1">search:</label>
@@ -32,7 +32,7 @@
 
 {entries%shortlogentry}
 
-<form action="{url}log">
+<form action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p>
 <label for="search2">search:</label>
--- a/mercurial/templates/spartan/shortlogentry.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/shortlogentry.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -2,6 +2,6 @@
  <tr>
   <td class="age">{date|rfc822date}</td>
   <td class="author">{author|person}</td>
-  <td class="node"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></td>
+  <td class="node"><a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a></td>
  </tr>
 </table>
--- a/mercurial/templates/spartan/tags.tmpl	Sat Jan 19 17:20:39 2013 -0600
+++ b/mercurial/templates/spartan/tags.tmpl	Fri Feb 01 15:48:33 2013 -0600
@@ -1,21 +1,21 @@
 {header}
 <title>{repo|escape}: tags</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url}atom-tags" title="Atom feed for {repo|escape}: tags">
+   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}: tags">
 <link rel="alternate" type="application/rss+xml"
-   href="{url}rss-tags" title="RSS feed for {repo|escape}: tags">
+   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}: tags">
 </head>
 <body>
 
 <div class="buttons">
-<a href="{url}log{sessionvars%urlparameter}">changelog</a>
-<a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a>
-<a href="{url}graph{sessionvars%urlparameter}">graph</a>
-<a href="{url}branches{sessionvars%urlparameter}">branches</a>
-<a href="{url}file/{node|short}/{sessionvars%urlparameter}">files</a>
-<a href="{url}help{sessionvars%urlparameter}">help</a>
-<a type="application/rss+xml" href="{url}rss-tags">rss</a>
-<a type="application/atom+xml" href="{url}atom-tags">atom</a>
+<a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a>
+<a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a>
+<a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a>
+<a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a>
+<a href="{url|urlescape}file/{node|short}/{sessionvars%urlparameter}">files</a>
+<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>
+<a type="application/rss+xml" href="{url|urlescape}rss-tags">rss</a>
+<a type="application/atom+xml" href="{url|urlescape}atom-tags">atom</a>
 </div>
 
 <h2><a href="/">Mercurial</a> {pathdef%breadcrumb} / tags</h2>
--- a/tests/run-tests.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/run-tests.py	Fri Feb 01 15:48:33 2013 -0600
@@ -1252,7 +1252,7 @@
     os.environ['no_proxy'] = ''
     os.environ['NO_PROXY'] = ''
     os.environ['TERM'] = 'xterm'
-    os.environ['PYTHONHASHSEED'] = 'random'
+    os.environ['PYTHONHASHSEED'] = os.environ.get('PYTHONHASHSEED', 'random')
 
     # unset env related to hooks
     for k in os.environ.keys():
--- a/tests/test-audit-path.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-audit-path.t	Fri Feb 01 15:48:33 2013 -0600
@@ -86,7 +86,7 @@
   $ hg manifest -r4
   /tmp/test
   $ hg update -Cr4
-  abort: path contains illegal component: /tmp/test
+  abort: path contains illegal component: /tmp/test (glob)
   [255]
 
   $ cd ..
--- a/tests/test-bisect.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-bisect.t	Fri Feb 01 15:48:33 2013 -0600
@@ -508,3 +508,58 @@
 ensure that we still don't have a working dir
 
   $ hg parents
+
+
+Check that bisect does not break on obsolete changesets
+=========================================================
+
+  $ cat > ${TESTTMP}/obs.py << EOF
+  > import mercurial.obsolete
+  > mercurial.obsolete._enabled = True
+  > EOF
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
+
+tip is obsolete
+---------------------
+
+  $ hg debugobsolete `hg id --debug -i -r tip`
+  $ hg bisect --reset
+  $ hg bisect --good 15
+  $ hg bisect --bad 30
+  Testing changeset 22:06c7993750ce (15 changesets remaining, ~3 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect --command true
+  changeset 22:06c7993750ce: good
+  changeset 26:3efc6fd51aeb: good
+  changeset 28:8e0c2264c8af: good
+  changeset 29:b5bd63375ab9: good
+  The first bad revision is:
+  changeset:   30:ed2d2f24b11c
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:30 1970 +0000
+  summary:     msg 30
+  
+
+Changeset in the bad:good range is obsolete
+---------------------------------------------
+
+  $ hg up 30
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ echo 'a' >> a
+  $ hg ci -m "msg 32" -d "32 0"
+  $ hg bisect --reset
+  $ hg bisect --good .
+  $ hg bisect --bad 25
+  Testing changeset 28:8e0c2264c8af (6 changesets remaining, ~2 tests)
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg bisect --command true
+  changeset 28:8e0c2264c8af: good
+  changeset 26:3efc6fd51aeb: good
+  The first good revision is:
+  changeset:   26:3efc6fd51aeb
+  user:        test
+  date:        Thu Jan 01 00:00:26 1970 +0000
+  summary:     msg 26
+  
--- a/tests/test-bookmarks-pushpull.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-bookmarks-pushpull.t	Fri Feb 01 15:48:33 2013 -0600
@@ -47,7 +47,7 @@
   (run 'hg update' to get a working copy)
   $ hg bookmarks
      X                         0:4e3505fd9583
-     Y                         0:4e3505fd9583
+   * Y                         0:4e3505fd9583
      Z                         0:4e3505fd9583
   $ hg debugpushkey ../a namespaces
   bookmarks	
@@ -64,7 +64,7 @@
   importing bookmark X
   $ hg bookmark
      X                         0:4e3505fd9583
-     Y                         0:4e3505fd9583
+   * Y                         0:4e3505fd9583
      Z                         0:4e3505fd9583
 
 export bookmark by name
@@ -128,15 +128,15 @@
   $ echo c2 > f2
   $ hg ci -Am2
   adding f2
-  $ hg book -f @
-  $ hg book -f X
+  $ hg book -if @
+  $ hg book -if X
   $ hg book
      @                         1:9b140be10808
-   * X                         1:9b140be10808
+     X                         1:9b140be10808
      Y                         0:4e3505fd9583
      Z                         0:4e3505fd9583
      foo                       -1:000000000000
-     foobar                    1:9b140be10808
+   * foobar                    1:9b140be10808
 
   $ hg pull --config paths.foo=../a foo
   pulling from $TESTTMP/a (glob)
@@ -152,12 +152,12 @@
   $ hg book
      @                         1:9b140be10808
      @foo                      2:0d2164f0ce0d
-   * X                         1:9b140be10808
+     X                         1:9b140be10808
      X@foo                     2:0d2164f0ce0d
      Y                         0:4e3505fd9583
      Z                         2:0d2164f0ce0d
      foo                       -1:000000000000
-     foobar                    1:9b140be10808
+   * foobar                    1:9b140be10808
   $ hg push -f ../a
   pushing to ../a
   searching for changes
@@ -171,6 +171,18 @@
      Y                         0:4e3505fd9583
      Z                         1:0d2164f0ce0d
 
+revsets should not ignore divergent bookmarks
+
+  $ hg bookmark -fr 1 Z
+  $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n'
+  0:4e3505fd9583 Y
+  1:9b140be10808 @ X Z foobar
+  2:0d2164f0ce0d @foo X@foo
+  $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
+  2:0d2164f0ce0d @foo X@foo
+  $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n'
+  2:0d2164f0ce0d @foo X@foo
+
 update a remote bookmark from a non-head to a head
 
   $ hg up -q Y
@@ -299,7 +311,7 @@
   @	9b140be1080824d768c5a4691a564088eede71f9
   X	9b140be1080824d768c5a4691a564088eede71f9
   Y	c922c0139ca03858f655e4a2af4dd02796a63969
-  Z	0d2164f0ce0d8f1d6f94351eba04b794909be66c
+  Z	9b140be1080824d768c5a4691a564088eede71f9
   foo	0000000000000000000000000000000000000000
   foobar	9b140be1080824d768c5a4691a564088eede71f9
   $ hg out -B http://localhost:$HGPORT/
--- a/tests/test-bookmarks.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-bookmarks.t	Fri Feb 01 15:48:33 2013 -0600
@@ -458,7 +458,11 @@
   adding file changes
   added 2 changesets with 2 changes to 2 files (+1 heads)
   (run 'hg heads' to see heads, 'hg merge' to merge)
+
+update to current bookmark if it's not the parent
+
   $ hg update
+  updating to active bookmark Z
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg bookmarks
      X2                        1:925d80f479bb
--- a/tests/test-convert-git.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-convert-git.t	Fri Feb 01 15:48:33 2013 -0600
@@ -307,7 +307,7 @@
   $ echo 'sub' >> foo
   $ git add foo
   $ commit -a -m 'addfoo'
-  $ BASE=${PWD}
+  $ BASE=`pwd`
   $ cd ..
   $ mkdir git-repo6
   $ cd git-repo6
--- a/tests/test-dispatch.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-dispatch.t	Fri Feb 01 15:48:33 2013 -0600
@@ -46,10 +46,11 @@
 
   $ cd "$TESTTMP"
 
-OSError ... and with filename even when it is empty
+OSError "No such file or directory" / "The system cannot find the path
+specified" should include filename even when it is empty
 
   $ hg -R a archive ''
-  abort: No such file or directory: ''
+  abort: *: '' (glob)
   [255]
 
 #if no-outer-repo
--- a/tests/test-globalopts.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-globalopts.t	Fri Feb 01 15:48:33 2013 -0600
@@ -87,7 +87,7 @@
   abort: no repository found in '$TESTTMP' (.hg not found)!
   [255]
   $ hg -R b ann a/a
-  abort: a/a not under root '$TESTTMP/b'
+  abort: a/a not under root '$TESTTMP/b' (glob)
   [255]
   $ hg log
   abort: no repository found in '$TESTTMP' (.hg not found)!
--- a/tests/test-glog.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-glog.t	Fri Feb 01 15:48:33 2013 -0600
@@ -2109,4 +2109,17 @@
   o
   
 
+issue3772
+
+  $ hg glog -r :null
+  o  changeset:   -1:000000000000
+     user:
+     date:        Thu Jan 01 00:00:00 1970 +0000
+  
+  $ hg glog -r null:null
+  o  changeset:   -1:000000000000
+     user:
+     date:        Thu Jan 01 00:00:00 1970 +0000
+  
+
   $ cd ..
--- a/tests/test-help.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-help.t	Fri Feb 01 15:48:33 2013 -0600
@@ -790,9 +790,10 @@
   
   Commands:
   
-   clone  make a copy of an existing repository
-   paths  show aliases for remote repositories
-   update update working directory (or switch revisions)
+   bookmarks track a line of development with movable markers
+   clone     make a copy of an existing repository
+   paths     show aliases for remote repositories
+   update    update working directory (or switch revisions)
   
   Extensions:
   
--- a/tests/test-hgweb-commands.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-hgweb-commands.t	Fri Feb 01 15:48:33 2013 -0600
@@ -447,14 +447,6 @@
       </div>
     </td>
   </tr>
-  <tr>
-   <th class="author">change baseline</th>
-   <td class="author"></td>
-  </tr>
-  <tr>
-   <th class="author">current baseline</th>
-   <td class="author"><a href="/rev/000000000000">000000000000</a></td>
-  </tr>
   </table>
   
   <div class="overflow">
@@ -1370,4 +1362,63 @@
 
   $ cat errors.log
 
+bookmarks view doesn't choke on bookmarks on secret changesets (issue3774)
+
+  $ hg phase -fs 4
+  $ hg bookmark -r4 secret
+  $ cat > hgweb.cgi <<HGWEB
+  > from mercurial import demandimport; demandimport.enable()
+  > from mercurial.hgweb import hgweb
+  > from mercurial.hgweb import wsgicgi
+  > app = hgweb('.', 'test')
+  > wsgicgi.launch(app)
+  > HGWEB
+  $ . "$TESTDIR/cgienv"
+  $ PATH_INFO=/bookmarks; export PATH_INFO
+  $ QUERY_STRING='style=raw'
+  $ python hgweb.cgi
+
+listbookmarks hides secret bookmarks
+
+  $ PATH_INFO=/; export PATH_INFO
+  $ QUERY_STRING='cmd=listkeys&namespace=bookmarks'
+  $ python hgweb.cgi
+
+search works with filtering
+
+  $ PATH_INFO=/log; export PATH_INFO
+  $ QUERY_STRING='rev=babar'
+  $ python hgweb.cgi > search
+  $ grep Status search
+  Status: 200 Script output follows\r (esc)
+
+proper status for filtered revision
+
+
+(missing rev)
+
+  $ PATH_INFO=/rev/5; export PATH_INFO
+  $ QUERY_STRING='style=raw'
+  $ python hgweb.cgi #> search
+  Status: 404 Not Found\r (esc)
+  ETag: *\r (glob) (esc)
+  Content-Type: text/plain; charset=ascii\r (esc)
+  \r (esc)
+  
+  error: unknown revision '5'
+
+
+
+(filtered rev)
+
+  $ PATH_INFO=/rev/4; export PATH_INFO
+  $ QUERY_STRING='style=raw'
+  $ python hgweb.cgi #> search
+  Status: 404 Not Found\r (esc)
+  ETag: *\r (glob) (esc)
+  Content-Type: text/plain; charset=ascii\r (esc)
+  \r (esc)
+  
+  error: unknown revision '4'
+
   $ cd ..
--- a/tests/test-hgweb-diffs.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-hgweb-diffs.t	Fri Feb 01 15:48:33 2013 -0600
@@ -139,14 +139,6 @@
       </div>
     </td>
   </tr>
-  <tr>
-   <th class="author">change baseline</th>
-   <td class="author"></td>
-  </tr>
-  <tr>
-   <th class="author">current baseline</th>
-   <td class="author"><a href="/rev/000000000000">000000000000</a></td>
-  </tr>
   </table>
   
   <div class="overflow">
@@ -408,14 +400,6 @@
       </div>
     </td>
   </tr>
-  <tr>
-   <th class="author">change baseline</th>
-   <td class="author"></td>
-  </tr>
-  <tr>
-   <th class="author">current baseline</th>
-   <td class="author"><a href="/rev/000000000000">000000000000</a></td>
-  </tr>
   </table>
   
   <div class="overflow">
--- a/tests/test-hgweb-removed.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-hgweb-removed.t	Fri Feb 01 15:48:33 2013 -0600
@@ -112,14 +112,6 @@
       </div>
     </td>
   </tr>
-  <tr>
-   <th class="author">change baseline</th>
-   <td class="author"><a href="/rev/cb9a9f314b8b:c78f6c5cbea9">cb9a9f314b8b</a> </td>
-  </tr>
-  <tr>
-   <th class="author">current baseline</th>
-   <td class="author"><a href="/rev/cb9a9f314b8b">cb9a9f314b8b</a></td>
-  </tr>
   </table>
   
   <div class="overflow">
--- a/tests/test-histedit-drop.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-histedit-drop.t	Fri Feb 01 15:48:33 2013 -0600
@@ -123,4 +123,36 @@
   e
   f
 
+Drop the last changeset
+
+  $ cat > $EDITED <<EOF
+  > pick ee283cb5f2d5 e
+  > pick a4f7421b80f7 f
+  > drop f518305ce889 d
+  > EOF
+  $ HGEDITOR="cat \"$EDITED\" > " hg histedit ee283cb5f2d5 2>&1 | fixbundle
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg log --graph
+  @  changeset:   3:a4f7421b80f7
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     f
+  |
+  o  changeset:   2:ee283cb5f2d5
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     e
+  |
+  o  changeset:   1:d2ae7f538514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     b
+  |
+  o  changeset:   0:cb9a9f314b8b
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     a
+  
+
   $ cd ..
--- a/tests/test-histedit-obsolete.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-histedit-obsolete.t	Fri Feb 01 15:48:33 2013 -0600
@@ -153,6 +153,56 @@
 
   $ hg rebase  -r 'unstable()' -d .
 
+Test dropping of changeset on the top of the stack
+-------------------------------------------------------
+
+Nothing is rewritten below, the working directory parent must be change for the
+dropped changeset to be hidden.
+
+  $ cd ..
+  $ hg clone base droplast
+  updating to branch default
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd droplast
+  $ cat > commands.txt <<EOF
+  > pick 40db8afa467b 10 c
+  > drop b449568bf7fc 11 f
+  > EOF
+  $ hg histedit -r '40db8afa467b' --commands commands.txt
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg log -G
+  @  10:40db8afa467b c
+  |
+  o  0:cb9a9f314b8b a
+  
+
+With rewritten ancestors
+
+  $ echo e > e
+  $ hg add e
+  $ hg commit -m g
+  $ echo f > f
+  $ hg add f
+  $ hg commit -m h
+  $ cat > commands.txt <<EOF
+  > pick 47a8561c0449 12 g
+  > pick 40db8afa467b 10 c
+  > drop 1b3b05f35ff0 13 h
+  > EOF
+  $ hg histedit -r '40db8afa467b' --commands commands.txt
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -G
+  @  15:ee6544123ab8 c
+  |
+  o  14:269e713e9eae g
+  |
+  o  0:cb9a9f314b8b a
+  
+  $ cd ../base
+
+
 
 Test phases support
 ===========================================
--- a/tests/test-issue3084.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-issue3084.t	Fri Feb 01 15:48:33 2013 -0600
@@ -16,9 +16,9 @@
   $ hg commit -m "Add foo as a largefile"
 
   $ hg update -r 0
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   getting changed largefiles
   0 largefiles updated, 1 removed
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
   $ echo "normal" > foo
   $ hg add foo
--- a/tests/test-keyword.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-keyword.t	Fri Feb 01 15:48:33 2013 -0600
@@ -751,14 +751,14 @@
 
 |Note:
 |
-| After the last rollback, the "unserved" branchheads cache became invalid, but
+| After the last rollback, the "served" branchheads cache became invalid, but
 | all changesets in the repo were public. For filtering this means:
-|   "mutable" == "unserved" == ø.
+|   "immutable" == "served" == ø.
 |
-| As the "unserved" cache is invalid, we fall back to the "mutable" cache. But
-| no update is needed between "mutable" and "unserved" and the "unserved" cache
+| As the "served" cache is invalid, we fall back to the "immutable" cache. But
+| no update is needed between "immutable" and "served" and the "served" cache
 | is not updated on disk. The on-disk version therefore stays invalid for some
-| time. This explains why the "unserved" branchheads cache is detected as
+| time. This explains why the "served" branchheads cache is detected as
 | invalid here.
 
   $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
--- a/tests/test-largefiles-cache.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-largefiles-cache.t	Fri Feb 01 15:48:33 2013 -0600
@@ -45,27 +45,27 @@
 "missing"(!) file.
 
   $ hg update
+  getting changed largefiles
+  error getting id 7f7097b041ccf68cc5561e9600da4655d21c6d18 from url file:$TESTTMP/mirror for file large: can't get file locally (glob)
+  0 largefiles updated, 0 removed
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  getting changed largefiles
-  error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob)
-  0 largefiles updated, 0 removed
   $ hg status
   ! large
 
 Update working directory to null: this cleanup .hg/largefiles/dirstate
 
   $ hg update null
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   getting changed largefiles
   0 largefiles updated, 0 removed
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
 Update working directory to tip, again.
 
   $ hg update
+  getting changed largefiles
+  error getting id 7f7097b041ccf68cc5561e9600da4655d21c6d18 from url file:$TESTTMP/mirror for file large: can't get file locally (glob)
+  0 largefiles updated, 0 removed
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  getting changed largefiles
-  error getting 7f7097b041ccf68cc5561e9600da4655d21c6d18 from file:$TESTTMP/mirror for large: can't get file locally (glob)
-  0 largefiles updated, 0 removed
   $ hg status
   ! large
   $ cd ..
--- a/tests/test-largefiles-small-disk.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-largefiles-small-disk.t	Fri Feb 01 15:48:33 2013 -0600
@@ -57,7 +57,6 @@
   adding file changes
   added 1 changesets with 1 changes to 1 files
   updating to branch default
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   abort: No space left on device
   [255]
--- a/tests/test-largefiles.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-largefiles.t	Fri Feb 01 15:48:33 2013 -0600
@@ -506,9 +506,9 @@
 Test addremove with -R
 
   $ hg up -C
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ rm normal3
   $ rm sub/large4
   $ echo "testing addremove with patterns" > testaddremove.dat
@@ -524,9 +524,9 @@
 Test 3364
   $ hg clone . ../addrm
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ../addrm
   $ cat >> .hg/hgrc <<EOF
   > [hooks]
@@ -604,9 +604,9 @@
   C sub2/large6
   C sub2/large7
   $ hg up -C '.^'
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   0 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg remove large
   $ hg addremove --traceback
   $ hg ci -m "removed large"
@@ -715,9 +715,9 @@
 
   $ hg clone . ../b
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ../b
   $ hg log --template '{rev}:{node|short}  {desc|firstline}\n'
   7:daea875e9014  add/edit more largefiles
@@ -745,9 +745,9 @@
   adding file changes
   added 4 changesets with 10 changes to 4 files
   updating to branch default
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd c
   $ hg log --template '{rev}:{node|short}  {desc|firstline}\n'
   3:9e8fbc4bce62  copy files
@@ -767,9 +767,9 @@
 tests update).
 
   $ hg update -r 1
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat large1
   large11
   $ cat sub/large2
@@ -781,17 +781,17 @@
   $ rm "${USERCACHE}"/*
   $ hg clone --all-largefiles a a-backup
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   8 additional largefiles cached
 
   $ rm "${USERCACHE}"/*
   $ hg clone --all-largefiles -u 0 a a-clone0
   updating to branch default
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   9 additional largefiles cached
   $ hg -R a-clone0 sum
   parent: 0:30d30fe6a5be 
@@ -803,10 +803,18 @@
   $ rm "${USERCACHE}"/*
   $ hg clone --all-largefiles -u 1 a a-clone1
   updating to branch default
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   8 additional largefiles cached
+  $ hg -R a-clone1 verify --large --lfa --lfc
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  10 files, 8 changesets, 24 total revisions
+  searching 8 changesets for largefiles
+  verified contents of 13 revisions of 6 largefiles
   $ hg -R a-clone1 sum
   parent: 1:ce8896473775 
    edit files
@@ -828,9 +836,9 @@
   $ hg clone ../a
   destination directory: a
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ..
 
 Ensure base clone command argument validation
@@ -854,9 +862,9 @@
   adding file changes
   added 2 changesets with 8 changes to 4 files
   updating to branch default
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ rm "${USERCACHE}"/*
   $ cd a-backup
   $ hg pull --all-largefiles --config paths.default-push=bogus/path
@@ -877,9 +885,9 @@
 
   $ hg clone a d
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd b
   $ echo large4-modified > sub/large4
   $ echo normal3-modified > normal3
@@ -897,9 +905,9 @@
   $ cd ..
   $ hg clone d e
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd d
 
 More rebase testing, but also test that the largefiles are downloaded from
@@ -916,15 +924,15 @@
   M sub/normal4
   M sub2/large6
   saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
-  error getting eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from file:$TESTTMP/b for large3: can't get file locally (glob)
-  error getting eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from file:$TESTTMP/b for sub/large4: can't get file locally (glob)
-  error getting eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from file:$TESTTMP/b for large1: can't get file locally (glob)
-  error getting eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from file:$TESTTMP/b for sub/large2: can't get file locally (glob)
-  error getting eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from file:$TESTTMP/b for sub/large2: can't get file locally (glob)
-  error getting 5f78770c0e77ba4287ad6ef3071c9bf9c379742f from file:$TESTTMP/b for large1: can't get file locally (glob)
-  error getting eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from file:$TESTTMP/b for sub/large2: can't get file locally (glob)
-  error getting 4669e532d5b2c093a78eca010077e708a071bb64 from file:$TESTTMP/b for large1: can't get file locally (glob)
-  error getting 1deebade43c8c498a3c8daddac0244dc55d1331d from file:$TESTTMP/b for sub/large2: can't get file locally (glob)
+  error getting id eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from url file:$TESTTMP/b for file large3: can't get file locally (glob)
+  error getting id eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from url file:$TESTTMP/b for file sub/large4: can't get file locally (glob)
+  error getting id eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from url file:$TESTTMP/b for file large1: can't get file locally (glob)
+  error getting id eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from url file:$TESTTMP/b for file sub/large2: can't get file locally (glob)
+  error getting id eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from url file:$TESTTMP/b for file sub/large2: can't get file locally (glob)
+  error getting id 5f78770c0e77ba4287ad6ef3071c9bf9c379742f from url file:$TESTTMP/b for file large1: can't get file locally (glob)
+  error getting id eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 from url file:$TESTTMP/b for file sub/large2: can't get file locally (glob)
+  error getting id 4669e532d5b2c093a78eca010077e708a071bb64 from url file:$TESTTMP/b for file large1: can't get file locally (glob)
+  error getting id 1deebade43c8c498a3c8daddac0244dc55d1331d from url file:$TESTTMP/b for file sub/large2: can't get file locally (glob)
   0 additional largefiles cached
   9 largefiles failed to download
   nothing to rebase
@@ -1065,9 +1073,9 @@
   $ hg revert sub2/large7
   $ hg -q update --clean -r null
   $ hg update --clean
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat normal3
   normal3-modified
   $ cat sub/normal4
@@ -1086,22 +1094,22 @@
 demonstrate misfeature: .orig file is overwritten on every update -C,
 also when clean:
   $ hg update --clean
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   0 largefiles updated, 0 removed
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat sub2/large7.orig
   large7
   $ rm sub2/large7.orig .hglf/sub2/large7.orig
 
 Now "update check" is happy.
   $ hg update --check 8
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg update --check
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 Test removing empty largefiles directories on update
   $ test -d sub2 && echo "sub2 exists"
@@ -1170,6 +1178,12 @@
 
 "verify --large" actually verifies largefiles
 
+- Where Do We Come From? What Are We? Where Are We Going?
+  $ pwd
+  $TESTTMP/e
+  $ hg paths
+  default = $TESTTMP/d (glob)
+
   $ hg verify --large
   checking changesets
   checking manifests
@@ -1179,6 +1193,66 @@
   searching 1 changesets for largefiles
   verified existence of 3 revisions of 3 largefiles
 
+- introduce missing blob in local store repo and make sure that this is caught:
+  $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
+  $ hg verify --large
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  10 files, 10 changesets, 28 total revisions
+  searching 1 changesets for largefiles
+  changeset 9:598410d3eb9a: sub/large4 missing
+    (looked for hash e166e74c7303192238d60af5a9c4ce9bef0b7928)
+  verified existence of 3 revisions of 3 largefiles
+  [1]
+
+- introduce corruption and make sure that it is caught when checking content:
+  $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
+  $ hg verify -q --large --lfc
+  searching 1 changesets for largefiles
+  changeset 9:598410d3eb9a: sub/large4: contents differ
+    ($TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928: (glob)
+    expected hash e166e74c7303192238d60af5a9c4ce9bef0b7928,
+    but got 1f19b76d5b3cad1472c87efb42b582c97e040060)
+  verified contents of 3 revisions of 3 largefiles
+  [1]
+
+- cleanup
+  $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
+
+- verifying all revisions will fail because we didn't clone all largefiles to d:
+  $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
+  $ hg verify -q --large --lfa --lfc
+  searching 10 changesets for largefiles
+  changeset 0:30d30fe6a5be: large1 missing
+    (looked for hash 4669e532d5b2c093a78eca010077e708a071bb64)
+  changeset 0:30d30fe6a5be: sub/large2 missing
+    (looked for hash 1deebade43c8c498a3c8daddac0244dc55d1331d)
+  changeset 1:ce8896473775: large1 missing
+    (looked for hash 5f78770c0e77ba4287ad6ef3071c9bf9c379742f)
+  changeset 1:ce8896473775: sub/large2: contents differ
+    ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
+    expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
+    but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
+  changeset 3:9e8fbc4bce62: large1: contents differ
+    ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
+    expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
+    but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
+  changeset 4:74c02385b94c: large3: contents differ
+    ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
+    expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
+    but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
+  changeset 4:74c02385b94c: sub/large4: contents differ
+    ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
+    expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
+    but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
+  verified contents of 15 revisions of 6 largefiles
+  [1]
+
+- cleanup
+  $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
+
 Merging does not revert to old versions of largefiles and also check
 that merging after having pulled from a non-default remote works
 correctly.
@@ -1190,14 +1264,14 @@
   adding file changes
   added 8 changesets with 24 changes to 10 files
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg clone temp f
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
 # Delete the largefiles in the largefiles system cache so that we have an
 # opportunity to test that caching after a pull works.
   $ rm "${USERCACHE}"/*
@@ -1269,8 +1343,8 @@
 
 - revert should be able to revert files introduced in a pending merge
   $ hg revert --all -r .
-  removing .hglf/large
-  undeleting .hglf/sub2/large6
+  removing .hglf/large (glob)
+  undeleting .hglf/sub2/large6 (glob)
 
 Test that a normal file and a largefile with the same name and path cannot
 coexist.
@@ -1289,9 +1363,9 @@
   adding file changes
   added 9 changesets with 26 changes to 10 files
   updating to branch default
-  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   3 largefiles updated, 0 removed
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd g
   $ hg transplant -s ../d 598410d3eb9a
   searching for changes
@@ -1338,8 +1412,10 @@
   normal3-modified
   $ hg cat -r '.^' normal3
   normal3-modified
-  $ hg cat -r '.^' sub/large4
+  $ hg cat -r '.^' sub/large4 doesntexist
   large4-modified
+  doesntexist: no such file in rev a381d2c8c80e
+  [1]
 
 Test that renaming a largefile results in correct output for status
 
@@ -1504,9 +1580,10 @@
   $ cd ..
 
 putlfile errors are shown (issue3123)
-Corrupt the cached largefile in r7 and in the usercache (required for testing on vfat)
-  $ echo corruption > "$TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8"
-  $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
+Corrupt the cached largefile in r7 and move it out of the servers usercache
+  $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
+  $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
+  $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
   $ hg init empty
   $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
   >   --config 'web.allow_push=*' --config web.push_ssl=False
@@ -1517,6 +1594,19 @@
   remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
   abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
   [255]
+  $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
+Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
+  $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
+  $ hg push -R r7 http://localhost:$HGPORT1
+  pushing to http://localhost:$HGPORT1/
+  searching for changes
+  searching for changes
+  remote: adding changesets
+  remote: adding manifests
+  remote: adding file changes
+  remote: added 2 changesets with 2 changes to 2 files
+  $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
+  server side corruption
   $ rm -rf empty
 
 Push a largefiles repository to a served empty repository
@@ -1531,7 +1621,7 @@
   >   --config 'web.allow_push=*' --config web.push_ssl=False
   $ cat hg.pid >> $DAEMON_PIDS
   $ rm "${USERCACHE}"/*
-  $ hg push -R r8 http://localhost:$HGPORT2
+  $ hg push -R r8 http://localhost:$HGPORT2/#default
   pushing to http://localhost:$HGPORT2/
   searching for changes
   searching for changes
@@ -1539,11 +1629,68 @@
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
+  $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
+  $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
 
-Clone over http, with largefiles being pulled on update, not on clone.
+Clone over http, no largefiles pulled on clone.
+
+  $ hg clone http://localhost:$HGPORT2/#default http-clone -U
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+
+test 'verify' with remotestore:
+
+  $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
+  $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
+  $ hg -R http-clone verify --large --lfa
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  searching 1 changesets for largefiles
+  changeset 0:cf03e5bb9936: f1 missing
+  verified existence of 1 revisions of 1 largefiles
+  [1]
+  $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
+  $ hg -R http-clone -q verify --large --lfa
+  searching 1 changesets for largefiles
+  verified existence of 1 revisions of 1 largefiles
 
-  $ hg clone -q http://localhost:$HGPORT2/ http-clone -U
+largefiles pulled on update - a largefile missing on the server:
+  $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
+  $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
+  getting changed largefiles
+  abort: remotestore: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 is missing
+  [255]
+  $ hg -R http-clone up -Cqr null
 
+largefiles pulled on update - a largefile corrupted on the server:
+  $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
+  $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
+  getting changed largefiles
+  f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
+  0 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg -R http-clone st
+  ! f1
+  $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
+  $ [ ! -f http-clone/f1 ]
+  $ [ ! -f http-clone-usercache ]
+  $ hg -R http-clone verify --large --lfc
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  1 files, 1 changesets, 1 total revisions
+  searching 1 changesets for largefiles
+  verified contents of 1 revisions of 1 largefiles
+  $ hg -R http-clone up -Cqr null
+
+largefiles pulled on update - no server side problems:
+  $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
   $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
   resolving manifests
    overwrite: False, partial: False
@@ -1551,7 +1698,6 @@
    .hglf/f1: remote created -> g
   updating: .hglf/f1 1/1 files (100.00%)
   getting .hglf/f1
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   using http://localhost:$HGPORT2/
   sending capabilities command
@@ -1561,11 +1707,12 @@
   sending getlfile command
   found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
   1 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
   $ ls http-clone-usercache/*
   http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
 
-  $ rm -rf empty http-clone http-clone-usercache
+  $ rm -rf empty http-clone*
 
 used all HGPORTs, kill all daemons
   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
@@ -1601,9 +1748,9 @@
   adding file changes
   added 1 changesets with 1 changes to 1 files
   updating to branch default
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd ..
   $ chmod -R u+w alice/pubrepo
   $ HOME="$ORIGHOME"
@@ -1755,23 +1902,48 @@
   A normal.txt
   Invoking status precommit hook
   M .hgsubstate
-  $ hg archive -S lf_subrepo_archive
-  $ find lf_subrepo_archive | sort
-  lf_subrepo_archive
-  lf_subrepo_archive/.hg_archival.txt
-  lf_subrepo_archive/.hgsub
-  lf_subrepo_archive/.hgsubstate
-  lf_subrepo_archive/a
-  lf_subrepo_archive/a/b
-  lf_subrepo_archive/a/b/c
-  lf_subrepo_archive/a/b/c/d
-  lf_subrepo_archive/a/b/c/d/e.large.txt
-  lf_subrepo_archive/a/b/c/d/e.normal.txt
-  lf_subrepo_archive/a/b/c/x
-  lf_subrepo_archive/a/b/c/x/y.normal.txt
-  lf_subrepo_archive/subrepo
-  lf_subrepo_archive/subrepo/large.txt
-  lf_subrepo_archive/subrepo/normal.txt
+  $ hg archive -S ../lf_subrepo_archive
+  $ find ../lf_subrepo_archive | sort
+  ../lf_subrepo_archive
+  ../lf_subrepo_archive/.hg_archival.txt
+  ../lf_subrepo_archive/.hgsub
+  ../lf_subrepo_archive/.hgsubstate
+  ../lf_subrepo_archive/a
+  ../lf_subrepo_archive/a/b
+  ../lf_subrepo_archive/a/b/c
+  ../lf_subrepo_archive/a/b/c/d
+  ../lf_subrepo_archive/a/b/c/d/e.large.txt
+  ../lf_subrepo_archive/a/b/c/d/e.normal.txt
+  ../lf_subrepo_archive/a/b/c/x
+  ../lf_subrepo_archive/a/b/c/x/y.normal.txt
+  ../lf_subrepo_archive/subrepo
+  ../lf_subrepo_archive/subrepo/large.txt
+  ../lf_subrepo_archive/subrepo/normal.txt
+
+Test update with subrepos.
+
+  $ hg update 0
+  getting changed largefiles
+  0 largefiles updated, 1 removed
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg status -S
+  $ hg update tip
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg status -S
+# modify a large file
+  $ echo "modified" > subrepo/large.txt
+  $ hg st -S
+  M subrepo/large.txt
+# update -C should revert the change.
+  $ hg update -C
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  getting changed largefiles
+  0 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg status -S
 
 Test archiving a revision that references a subrepo that is not yet
 cloned (see test-subrepo-recursion.t):
@@ -1817,6 +1989,36 @@
   .hglf/large.dat
   .hglf/large2.dat
 
+Test actions on largefiles using relative paths from subdir
+
+  $ mkdir sub
+  $ cd sub
+  $ echo anotherlarge > anotherlarge
+  $ hg add --large anotherlarge
+  $ hg st
+  A sub/anotherlarge
+  $ hg st anotherlarge
+  A anotherlarge
+  $ hg commit -m anotherlarge anotherlarge
+  Invoking status precommit hook
+  A sub/anotherlarge
+  $ hg log anotherlarge
+  changeset:   1:9627a577c5e9
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     anotherlarge
+  
+  $ echo more >> anotherlarge
+  $ hg st .
+  M anotherlarge
+  $ hg cat anotherlarge
+  anotherlarge
+  $ hg revert anotherlarge
+  $ hg st
+  ? sub/anotherlarge.orig
+  $ cd ..
+
   $ cd ..
 
 issue3651: summary/outgoing with largefiles shows "no remote repo"
--- a/tests/test-lfconvert.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-lfconvert.t	Fri Feb 01 15:48:33 2013 -0600
@@ -78,9 +78,9 @@
 "lfconvert" converts content correctly
   $ cd largefiles-repo
   $ hg up
-  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   2 largefiles updated, 0 removed
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg locate
   .hglf/large
   .hglf/sub/maybelarge.dat
@@ -187,9 +187,9 @@
   normal1
   stuff/normal2
   $ hg update
-  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   getting changed largefiles
   1 largefiles updated, 0 removed
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat stuff/normal2
   alsonormal
   blah
@@ -349,7 +349,7 @@
   $ rm largefiles-repo/.hg/largefiles/*
   $ hg lfconvert --to-normal issue3519 normalized3519
   initializing destination normalized3519
-  error getting 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 from file:$TESTTMP/largefiles-repo for large: can't get file locally (glob)
+  error getting id 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 from url file:$TESTTMP/largefiles-repo for file large: can't get file locally (glob)
   abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
   [255]
 
--- a/tests/test-log.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-log.t	Fri Feb 01 15:48:33 2013 -0600
@@ -1201,6 +1201,23 @@
   $ hg log --template='{rev}:{node}\n'
   1:a765632148dc55d38c35c4f247c618701886cb2f
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
+  $ hg debugsetparents 1
+  $ hg up -q null
+
+bookmarks prevent a changeset being hidden
+
+  $ hg bookmark --hidden -r 1 X
+  $ hg log --template '{rev}:{node}\n'
+  1:a765632148dc55d38c35c4f247c618701886cb2f
+  0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
+  $ hg bookmark -d X
+
+divergent bookmarks are not hidden
+
+  $ hg bookmark --hidden -r 1 X@foo
+  $ hg log --template '{rev}:{node}\n'
+  1:a765632148dc55d38c35c4f247c618701886cb2f
+  0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
 
 clear extensions configuration
   $ echo '[extensions]' >> $HGRCPATH
@@ -1296,4 +1313,18 @@
   changeset:   0:65624cd9070a
   $ hg log -l1 .d6/f1 | grep changeset
   changeset:   0:65624cd9070a
+
+issue3772: hg log -r :null showing revision 0 as well
+
+  $ hg log -r :null
+  changeset:   -1:000000000000
+  user:        
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  
+  $ hg log -r null:null
+  changeset:   -1:000000000000
+  user:        
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  
+
   $ cd ..
--- a/tests/test-merge-types.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-merge-types.t	Fri Feb 01 15:48:33 2013 -0600
@@ -197,6 +197,26 @@
   f is a plain file with content:
   f
 
+Test removed 'x' flag merged with content change - both ways
+
+  $ hg up -Cqr0
+  $ echo change > f
+  $ hg ci -qm3
+  $ hg merge -r1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ tellmeabout f
+  f is a plain file with content:
+  change
+
+  $ hg up -qCr1
+  $ hg merge -r3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ tellmeabout f
+  f is a plain file with content:
+  change
+
   $ cd ..
 
 Test merge with no common ancestor:
--- a/tests/test-obsolete-changeset-exchange.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-obsolete-changeset-exchange.t	Fri Feb 01 15:48:33 2013 -0600
@@ -53,3 +53,35 @@
   crosschecking files in changesets and manifests
   checking files
   2 files, 2 changesets, 2 total revisions
+
+Adding a changeset going extinct locally
+------------------------------------------
+
+Pull a changeset that will immediatly goes extinct (because you already have a
+marker to obsolete him)
+(test resolution of issue3788)
+
+  $ hg phase --draft --force f89bcc95eba5
+  $ hg phase -R ../other --draft --force f89bcc95eba5
+  $ hg commit --amend -m "A''"
+  $ hg --hidden --config extensions.mq= strip  --no-backup f89bcc95eba5
+  $ hg pull ../other
+  pulling from ../other
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+
+check that bundle is not affected
+
+  $ hg bundle --hidden --rev f89bcc95eba5 --base "f89bcc95eba5^" ../f89bcc95eba5.hg
+  1 changesets found
+  $ hg --hidden --config extensions.mq= strip --no-backup f89bcc95eba5
+  $ hg unbundle ../f89bcc95eba5.hg
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 0 changes to 1 files (+1 heads)
+  (run 'hg heads' to see heads)
--- a/tests/test-obsolete.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-obsolete.t	Fri Feb 01 15:48:33 2013 -0600
@@ -55,6 +55,17 @@
   $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
   $ hg debugobsolete
   97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
+
+(test that mercurial is not confused)
+
+  $ hg up null --quiet # having 0 as parent prevents it to be hidden
+  $ hg tip
+  changeset:   -1:000000000000
+  tag:         tip
+  user:        
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  
+  $ hg up --hidden tip --quiet
   $ cd ..
 
 Killing a single changeset with replacement
@@ -307,11 +318,38 @@
 Destination repo does not have any data
 ---------------------------------------
 
+Simple incoming test
+
+  $ hg init tmpc
+  $ cd tmpc
+  $ hg incoming ../tmpb
+  comparing with ../tmpb
+  changeset:   0:1f0dee641bb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add a
+  
+  changeset:   1:7c3bad9141dc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add b
+  
+  changeset:   2:245bde4270cd
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add original_c
+  
+  changeset:   6:6f9641995072
+  tag:         tip
+  parent:      1:7c3bad9141dc
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add n3w_3_c
+  
+
 Try to pull markers
 (extinct changeset are excluded but marker are pushed)
 
-  $ hg init tmpc
-  $ cd tmpc
   $ hg pull ../tmpb
   pulling from ../tmpb
   requesting all changes
@@ -350,7 +388,7 @@
 
   $ cd ..
 
-Try to pull markers
+Try to push markers
 
   $ hg init tmpd
   $ hg -R tmpb push tmpd
@@ -652,6 +690,16 @@
   $ mkcommit obsolete_e
   created new head
   $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
+  $ hg outgoing ../tmpf # parasite hg outgoing testin
+  comparing with ../tmpf
+  searching for changes
+  changeset:   6:3de5eca88c00
+  tag:         tip
+  parent:      3:6f9641995072
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add obsolete_e
+  
   $ hg push ../tmpf
   pushing to ../tmpf
   searching for changes
@@ -660,6 +708,8 @@
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
 
+#if serve
+
 check hgweb does not explode
 ====================================
 
@@ -693,6 +743,24 @@
 
   $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar'
   200 Script output follows
+
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/68'
+  200 Script output follows
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
+  404 Not Found
+  [1]
+
+check that web.view config option:
+
+  $ kill `cat hg.pid`
+  $ cat >> .hg/hgrc << EOF
+  > [web]
+  > view=all
+  > EOF
+  $ wait
+  $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
+  200 Script output follows
   $ kill `cat hg.pid`
 
 Checking _enable=False warning if obsolete marker exists
@@ -708,3 +776,4 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add celestine
   
+#endif
--- a/tests/test-parents.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-parents.t	Fri Feb 01 15:48:33 2013 -0600
@@ -71,7 +71,7 @@
   
 
   $ hg parents -r 2 ../a
-  abort: ../a not under root '$TESTTMP/repo'
+  abort: ../a not under root '$TESTTMP/repo' (glob)
   [255]
 
 
--- a/tests/test-phases.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-phases.t	Fri Feb 01 15:48:33 2013 -0600
@@ -173,7 +173,7 @@
 
 :note: The "(+1 heads)" is wrong as we do not had any visible head
 
-check that branch cache with "unserved" filter are properly computed and stored
+check that branch cache with "served" filter are properly computed and stored
 
   $ ls ../push-dest/.hg/cache/branchheads*
   ../push-dest/.hg/cache/branchheads-served
--- a/tests/test-push-validation.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-push-validation.t	Fri Feb 01 15:48:33 2013 -0600
@@ -44,7 +44,7 @@
   [1]
 
   $ hg push
-  pushing to $TESTTMP/test
+  pushing to $TESTTMP/test (glob)
   searching for changes
   adding changesets
   adding manifests
--- a/tests/test-rebase-bookmarks.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-rebase-bookmarks.t	Fri Feb 01 15:48:33 2013 -0600
@@ -56,17 +56,35 @@
   $ cd a1
   $ hg up -q Z
 
+Test deleting divergent bookmarks from dest (issue3685)
+
+  $ hg book -r 3 Z@diverge
+
+... and also test that bookmarks not on dest or not being moved aren't deleted
+
+  $ hg book -r 3 X@diverge
+  $ hg book -r 0 Y@diverge
+
+  $ hg tglog
+  o  3: 'D' bookmarks: W X@diverge Z@diverge
+  |
+  | @  2: 'C' bookmarks: Y Z
+  | |
+  | o  1: 'B' bookmarks: X
+  |/
+  o  0: 'A' bookmarks: Y@diverge
+  
   $ hg rebase -s Y -d 3
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
   @  3: 'C' bookmarks: Y Z
   |
-  o  2: 'D' bookmarks: W
+  o  2: 'D' bookmarks: W X@diverge
   |
   | o  1: 'B' bookmarks: X
   |/
-  o  0: 'A' bookmarks:
+  o  0: 'A' bookmarks: Y@diverge
   
 Keep bookmarks to the correct rebased changeset
 
--- a/tests/test-rebase-obsolete.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-rebase-obsolete.t	Fri Feb 01 15:48:33 2013 -0600
@@ -385,3 +385,74 @@
   o  0:cd010b8cd998 A
   
   $ cd ..
+
+test on rebase dropping a merge
+
+(setup)
+
+  $ hg init dropmerge
+  $ cd dropmerge
+  $ hg unbundle "$TESTDIR/bundles/rebase.hg"
+  adding changesets
+  adding manifests
+  adding file changes
+  added 8 changesets with 7 changes to 7 files (+2 heads)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg up 3
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg merge 7
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m 'M'
+  $ echo I > I
+  $ hg add I
+  $ hg ci -m I
+  $ hg log -G
+  @  9:4bde274eefcf I
+  |
+  o    8:53a6a128b2b7 M
+  |\
+  | o  7:02de42196ebe H
+  | |
+  | | o  6:eea13746799a G
+  | |/|
+  | o |  5:24b6387c8c8c F
+  | | |
+  | | o  4:9520eea781bc E
+  | |/
+  o |  3:32af7686d403 D
+  | |
+  o |  2:5fddd98957c8 C
+  | |
+  o |  1:42ccdea3bb16 B
+  |/
+  o  0:cd010b8cd998 A
+  
+(actual test)
+
+  $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)'
+  $ hg log -G
+  @  12:acd174b7ab39 I
+  |
+  o  11:6c11a6218c97 H
+  |
+  | o  10:b5313c85b22e D
+  |/
+  | o    8:53a6a128b2b7 M
+  | |\
+  | | x  7:02de42196ebe H
+  | | |
+  o---+  6:eea13746799a G
+  | | |
+  | | o  5:24b6387c8c8c F
+  | | |
+  o---+  4:9520eea781bc E
+   / /
+  x |  3:32af7686d403 D
+  | |
+  o |  2:5fddd98957c8 C
+  | |
+  o |  1:42ccdea3bb16 B
+  |/
+  o  0:cd010b8cd998 A
+  
--- a/tests/test-rename.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-rename.t	Fri Feb 01 15:48:33 2013 -0600
@@ -612,7 +612,7 @@
   [255]
   $ hg status -C
   $ hg rename d1/d11/a1 ..
-  abort: ../a1 not under root '$TESTTMP'
+  abort: ../a1 not under root '$TESTTMP' (glob)
   [255]
   $ hg status -C
 
--- a/tests/test-revset.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-revset.t	Fri Feb 01 15:48:33 2013 -0600
@@ -758,6 +758,37 @@
   $ hg log -r "${ISSUE3669_TIP}^" --template '{rev}\n'
   8
 
+test or-ed indirect predicates (issue3775)
+
+  $ log '6 or 6^1' | sort
+  5
+  6
+  $ log '6^1 or 6' | sort
+  5
+  6
+  $ log '4 or 4~1' | sort
+  2
+  4
+  $ log '4~1 or 4' | sort
+  2
+  4
+  $ log '(0 or 2):(4 or 6) or 0 or 6' | sort
+  0
+  1
+  2
+  3
+  4
+  5
+  6
+  $ log '0 or 6 or (0 or 2):(4 or 6)' | sort
+  0
+  1
+  2
+  3
+  4
+  5
+  6
+
 tests for 'remote()' predicate:
 #.  (csets in remote) (id)            (remote)
 1.  less than local   current branch  "default"
--- a/tests/test-subrepo.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-subrepo.t	Fri Feb 01 15:48:33 2013 -0600
@@ -725,6 +725,17 @@
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ test -f ../shared/subrepo-1/.hg/sharedpath
   [1]
+  $ hg -R ../shared in
+  abort: repository default not found!
+  [255]
+  $ hg -R ../shared/subrepo-2 showconfig paths
+  paths.default=$TESTTMP/subrepo-status/subrepo-2
+  $ hg -R ../shared/subrepo-1 sum --remote
+  parent: -1:000000000000 tip (empty repository)
+  branch: default
+  commit: (clean)
+  update: (current)
+  remote: (synced)
 
 Check hg update --clean
   $ cd $TESTTMP/t
@@ -1051,3 +1062,27 @@
   ? s/f19
   $ rm s/f19
   $ cd ..
+
+Courtesy phases synchronisation to publishing server does not block the push
+(issue3781)
+
+  $ cp -r main issue3781
+  $ cp -r main issue3781-dest
+  $ cd issue3781-dest/s
+  $ hg phase tip # show we have draft changeset
+  5: draft
+  $ chmod a-w .hg/store/phaseroots # prevent phase push
+  $ cd ../../issue3781
+  $ cat >> .hg/hgrc << EOF
+  > [paths]
+  > default=../issue3781-dest/
+  > EOF
+  $ hg push
+  pushing to $TESTTMP/issue3781-dest
+  pushing subrepo s to $TESTTMP/issue3781-dest/s
+  searching for changes
+  no changes found
+  searching for changes
+  no changes found
+  [1]
+
--- a/tests/test-walk.t	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/test-walk.t	Fri Feb 01 15:48:33 2013 -0600
@@ -181,10 +181,10 @@
   f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon
   f  mammals/skunk                   mammals/skunk
   $ hg debugwalk ..
-  abort: .. not under root '$TESTTMP/t'
+  abort: .. not under root '$TESTTMP/t' (glob)
   [255]
   $ hg debugwalk beans/../..
-  abort: beans/../.. not under root '$TESTTMP/t'
+  abort: beans/../.. not under root '$TESTTMP/t' (glob)
   [255]
   $ hg debugwalk .hg
   abort: path contains illegal component: .hg (glob)
@@ -209,7 +209,7 @@
   f  beans/pinto     beans/pinto
   f  beans/turtle    beans/turtle
   $ hg debugwalk `pwd`/..
-  abort: $TESTTMP/t/.. not under root '$TESTTMP/t'
+  abort: $TESTTMP/t/.. not under root '$TESTTMP/t' (glob)
   [255]
 
 Test patterns:
--- a/tests/tinyproxy.py	Sat Jan 19 17:20:39 2013 -0600
+++ b/tests/tinyproxy.py	Fri Feb 01 15:48:33 2013 -0600
@@ -107,7 +107,10 @@
                         out = self.connection
                     else:
                         out = soc
-                    data = i.recv(8192)
+                    try:
+                        data = i.recv(8192)
+                    except socket.error:
+                        break
                     if data:
                         out.send(data)
                         count = 0