Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/hgwebdir_mod.py @ 7637:1d54e2f6c0b7
error: move repo errors
rename NoCapability to CapabilityError
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 12 Jan 2009 10:42:31 -0600 |
parents | 3ccaefc84f45 |
children | 176d3d681702 |
comparison
equal
deleted
inserted
replaced
7636:e3f8c6d6b72e | 7637:1d54e2f6c0b7 |
---|---|
6 # This software may be used and distributed according to the terms | 6 # This software may be used and distributed according to the terms |
7 # of the GNU General Public License, incorporated herein by reference. | 7 # of the GNU General Public License, incorporated herein by reference. |
8 | 8 |
9 import os | 9 import os |
10 from mercurial.i18n import _ | 10 from mercurial.i18n import _ |
11 from mercurial.repo import RepoError | 11 from mercurial import ui, hg, util, templater, templatefilters, error |
12 from mercurial import ui, hg, util, templater, templatefilters | |
13 from common import ErrorResponse, get_mtime, staticfile, style_map, paritygen,\ | 12 from common import ErrorResponse, get_mtime, staticfile, style_map, paritygen,\ |
14 get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR | 13 get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR |
15 from hgweb_mod import hgweb | 14 from hgweb_mod import hgweb |
16 from request import wsgirequest | 15 from request import wsgirequest |
17 | 16 |
148 repo = hg.repository(self.parentui, real) | 147 repo = hg.repository(self.parentui, real) |
149 return hgweb(repo).run_wsgi(req) | 148 return hgweb(repo).run_wsgi(req) |
150 except IOError, inst: | 149 except IOError, inst: |
151 msg = inst.strerror | 150 msg = inst.strerror |
152 raise ErrorResponse(HTTP_SERVER_ERROR, msg) | 151 raise ErrorResponse(HTTP_SERVER_ERROR, msg) |
153 except RepoError, inst: | 152 except error.RepoError, inst: |
154 raise ErrorResponse(HTTP_SERVER_ERROR, str(inst)) | 153 raise ErrorResponse(HTTP_SERVER_ERROR, str(inst)) |
155 | 154 |
156 # browse subdirectories | 155 # browse subdirectories |
157 subdir = virtual + '/' | 156 subdir = virtual + '/' |
158 if [r for r in repos if r.startswith(subdir)]: | 157 if [r for r in repos if r.startswith(subdir)]: |