changeset 5330:4528858e7202

make identify an optionalrepo command Fixes issue726.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 24 Sep 2007 19:00:11 -0300
parents 7e6138cb8d38
children 8ee5b8129e7b
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1489,6 +1489,10 @@ def identify(ui, repo, source=None,
     name for non-default branches.
     """
 
+    if not repo and not source:
+        raise util.Abort(_("There is no Mercurial repository here "
+                           "(.hg not found)"))
+
     hexfunc = ui.debugflag and hex or short
     default = not (num or id or branch or tags)
     output = []
@@ -3155,7 +3159,7 @@ table = {
 
 norepo = ("clone init version help debugancestor debugcomplete debugdata"
           " debugindex debugindexdot debugdate debuginstall")
-optionalrepo = ("paths serve showconfig")
+optionalrepo = ("identify paths serve showconfig")
 
 def dispatch(args):
     try: