--- a/mercurial/hgweb/webutil.py Mon Jul 30 08:18:25 2012 +0200
+++ b/mercurial/hgweb/webutil.py Mon Jul 30 11:02:10 2012 +0200
@@ -10,6 +10,8 @@
from mercurial import match, patch, scmutil, error, ui, util
from mercurial.i18n import _
from mercurial.node import hex, nullid
+from common import ErrorResponse
+from common import HTTP_NOT_FOUND
import difflib
def up(p):
@@ -154,11 +156,15 @@
return ctx
def filectx(repo, req):
+ if 'file' not in req.form:
+ raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
path = cleanpath(repo, req.form['file'][0])
if 'node' in req.form:
changeid = req.form['node'][0]
+ elif 'filenode' in req.form:
+ changeid = req.form['filenode'][0]
else:
- changeid = req.form['filenode'][0]
+ raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given')
try:
fctx = repo[changeid][path]
except error.RepoError: