diff --git a/rhodecode/lib/middleware/simplehg.py b/rhodecode/lib/middleware/simplehg.py --- a/rhodecode/lib/middleware/simplehg.py +++ b/rhodecode/lib/middleware/simplehg.py @@ -85,6 +85,10 @@ class SimpleHg(BaseVCSController): except: return HTTPInternalServerError()(environ, start_response) + # quick check if that dir exists... + if is_valid_repo(repo_name, self.basepath) is False: + return HTTPNotFound()(environ, start_response) + #====================================================================== # GET ACTION PULL or PUSH #====================================================================== @@ -163,10 +167,6 @@ class SimpleHg(BaseVCSController): baseui = make_ui('db') self.__inject_extras(repo_path, baseui, extras) - # quick check if that dir exists... - if is_valid_repo(repo_name, self.basepath) is False: - return HTTPNotFound()(environ, start_response) - try: # invalidate cache on push if action == 'push':