mercurial/hgweb/hgweb_mod.py
branchstable
changeset 13445 61a898576888
parent 12739 8dcd3203a261
child 13571 84bd3fd63afc
child 13958 71f51cc71652
--- a/mercurial/hgweb/hgweb_mod.py	Mon Feb 21 00:52:26 2011 +0100
+++ b/mercurial/hgweb/hgweb_mod.py	Mon Feb 21 00:57:19 2011 +0100
@@ -114,17 +114,17 @@
 
         cmd = req.form.get('cmd', [''])[0]
         if protocol.iscmd(cmd):
-            if query:
-                raise ErrorResponse(HTTP_NOT_FOUND)
-            if cmd in perms:
-                try:
+            try:
+                if query:
+                    raise ErrorResponse(HTTP_NOT_FOUND)
+                if cmd in perms:
                     self.check_perm(req, perms[cmd])
-                except ErrorResponse, inst:
-                    if cmd == 'unbundle':
-                        req.drain()
-                    req.respond(inst, protocol.HGTYPE)
-                    return '0\n%s\n' % inst.message
-            return protocol.call(self.repo, req, cmd)
+                return protocol.call(self.repo, req, cmd)
+            except ErrorResponse, inst:
+                if cmd == 'unbundle':
+                    req.drain()
+                req.respond(inst, protocol.HGTYPE)
+                return '0\n%s\n' % inst.message
 
         # translate user-visible url structure to internal structure