mercurial/cmdutil.py
changeset 4654 e0e73ba37983
parent 4635 63b9d2deed48
child 4667 c7a81e3ae80f
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -320,6 +320,9 @@ def dispatch(ui, args):
                 raise util.Abort(_("repository '%s' is not local") % path)
         except hg.RepoError:
             if cmd not in commands.optionalrepo.split():
+                if not path:
+                    raise hg.RepoError(_("There is no Mercurial repository here"
+                                         " (.hg not found)"))
                 raise
         d = lambda: func(ui, repo, *args, **cmdoptions)
     else: