106c2afad69b

web: return 404 when trying to access a nonexistant changeset
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 09 Jul 2010 22:32:17 -0400
parents 8ccff9378aba
children 1b9066798f87
branches/tags (none)
files review/web.py

Changes

--- a/review/web.py	Fri Jul 09 22:13:27 2010 -0400
+++ b/review/web.py	Fri Jul 09 22:32:17 2010 -0400
@@ -5,7 +5,7 @@
 import base64, sys, os, StringIO
 from hashlib import md5
 
-from mercurial import cmdutil, commands, hg, templatefilters
+from mercurial import cmdutil, commands, error, hg, templatefilters
 from mercurial.node import short
 from mercurial.util import email
 
@@ -158,7 +158,10 @@
         elif not app.read_only or app.allow_anon:
             return _handle_comment(revhash)
     
-    rcset = g.datastore[revhash]
+    try:
+        rcset = g.datastore[revhash]
+    except error.RepoLookupError:
+        abort(404)
     rev = rcset.target[revhash]
     
     cu_signoffs = rcset.signoffs_for_current_user()