mercurial/hg.py
changeset 405 99470ae6b424
parent 402 2fe8d66e3075
child 407 0e0d0670b2bc
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -358,6 +358,9 @@ class localrepository:
                 path = p
             self.path = os.path.join(path, ".hg")
 
+            if not create and not os.path.isdir(self.path):
+                raise "repository %s not found" % self.path
+
         self.root = path
         self.ui = ui