mercurial/hgweb/webcommands.py
changeset 6217 fe8dbbe9520d
parent 5993 948a41e77902
child 6368 2c370f08c486
equal deleted inserted replaced
6216:a88259018f79 6217:fe8dbbe9520d
     4 #
     4 #
     5 # This software may be used and distributed according to the terms
     5 # This software may be used and distributed according to the terms
     6 # of the GNU General Public License, incorporated herein by reference.
     6 # of the GNU General Public License, incorporated herein by reference.
     7 
     7 
     8 import os, mimetypes
     8 import os, mimetypes
     9 from mercurial import revlog, util, hg
     9 from mercurial import revlog, util
       
    10 from mercurial.repo import RepoError
    10 from common import staticfile, ErrorResponse, HTTP_OK, HTTP_NOT_FOUND
    11 from common import staticfile, ErrorResponse, HTTP_OK, HTTP_NOT_FOUND
    11 
    12 
    12 # __all__ is populated with the allowed commands. Be sure to add to it if
    13 # __all__ is populated with the allowed commands. Be sure to add to it if
    13 # you're adding a new command, or the new command won't work.
    14 # you're adding a new command, or the new command won't work.
    14 
    15 
    65             hi = req.form['rev'][0]
    66             hi = req.form['rev'][0]
    66         else:
    67         else:
    67             hi = web.repo.changelog.count() - 1
    68             hi = web.repo.changelog.count() - 1
    68         try:
    69         try:
    69             ctx = web.repo.changectx(hi)
    70             ctx = web.repo.changectx(hi)
    70         except hg.RepoError:
    71         except RepoError:
    71             return web.search(tmpl, hi) # XXX redirect to 404 page?
    72             return web.search(tmpl, hi) # XXX redirect to 404 page?
    72 
    73 
    73     return web.changelog(tmpl, ctx, shortlog = shortlog)
    74     return web.changelog(tmpl, ctx, shortlog = shortlog)
    74 
    75 
    75 def shortlog(web, req, tmpl):
    76 def shortlog(web, req, tmpl):