mercurial/hgweb/webcommands.py
changeset 7637 1d54e2f6c0b7
parent 7633 08cabecfa8a8
child 7671 06cf09c822c4
equal deleted inserted replaced
7636:e3f8c6d6b72e 7637:1d54e2f6c0b7
     8 import os, mimetypes, re, cgi, copy
     8 import os, mimetypes, re, cgi, copy
     9 import webutil
     9 import webutil
    10 from mercurial import error, archival, templatefilters
    10 from mercurial import error, archival, templatefilters
    11 from mercurial.node import short, hex, nullid
    11 from mercurial.node import short, hex, nullid
    12 from mercurial.util import binary, datestr
    12 from mercurial.util import binary, datestr
    13 from mercurial.repo import RepoError
       
    14 from common import paritygen, staticfile, get_contact, ErrorResponse
    13 from common import paritygen, staticfile, get_contact, ErrorResponse
    15 from common import HTTP_OK, HTTP_FORBIDDEN, HTTP_NOT_FOUND
    14 from common import HTTP_OK, HTTP_FORBIDDEN, HTTP_NOT_FOUND
    16 from mercurial import graphmod, util
    15 from mercurial import graphmod, util
    17 
    16 
    18 # __all__ is populated with the allowed commands. Be sure to add to it if
    17 # __all__ is populated with the allowed commands. Be sure to add to it if
   167             hi = req.form['rev'][0]
   166             hi = req.form['rev'][0]
   168         else:
   167         else:
   169             hi = len(web.repo) - 1
   168             hi = len(web.repo) - 1
   170         try:
   169         try:
   171             ctx = web.repo[hi]
   170             ctx = web.repo[hi]
   172         except RepoError:
   171         except error.RepoError:
   173             return _search(web, tmpl, hi) # XXX redirect to 404 page?
   172             return _search(web, tmpl, hi) # XXX redirect to 404 page?
   174 
   173 
   175     def changelist(limit=0, **map):
   174     def changelist(limit=0, **map):
   176         cl = web.repo.changelog
   175         cl = web.repo.changelog
   177         l = [] # build a list in forward order for efficiency
   176         l = [] # build a list in forward order for efficiency