mercurial/hgweb/webutil.py
changeset 25778 3a33412792f1
parent 25602 85fb416f2fa7
child 25999 1c75249e159b
equal deleted inserted replaced
25777:1c2a8db33b8f 25778:3a33412792f1
     4 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
     4 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
     5 #
     5 #
     6 # This software may be used and distributed according to the terms of the
     6 # This software may be used and distributed according to the terms of the
     7 # GNU General Public License version 2 or any later version.
     7 # GNU General Public License version 2 or any later version.
     8 
     8 
     9 import os, copy, urllib
     9 import os, copy
    10 from mercurial import match, patch, error, ui, util, pathutil, context
    10 from mercurial import match, patch, error, ui, util, pathutil, context
    11 from mercurial.i18n import _
    11 from mercurial.i18n import _
    12 from mercurial.node import hex, nullid, short
    12 from mercurial.node import hex, nullid, short
       
    13 from mercurial.templatefilters import revescape
    13 from common import ErrorResponse, paritygen
    14 from common import ErrorResponse, paritygen
    14 from common import HTTP_NOT_FOUND
    15 from common import HTTP_NOT_FOUND
    15 import difflib
    16 import difflib
    16 
    17 
    17 def up(p):
    18 def up(p):
   279         "branches": nodebranchdict(repo, ctx)
   280         "branches": nodebranchdict(repo, ctx)
   280     }
   281     }
   281 
   282 
   282 def symrevorshortnode(req, ctx):
   283 def symrevorshortnode(req, ctx):
   283     if 'node' in req.form:
   284     if 'node' in req.form:
   284         return urllib.quote(req.form['node'][0])
   285         return revescape(req.form['node'][0])
   285     else:
   286     else:
   286         return short(ctx.node())
   287         return short(ctx.node())
   287 
   288 
   288 def changesetentry(web, req, tmpl, ctx):
   289 def changesetentry(web, req, tmpl, ctx):
   289     '''Obtain a dictionary to be used to render the "changeset" template.'''
   290     '''Obtain a dictionary to be used to render the "changeset" template.'''