# HG changeset patch # User Alexis S. L. Carvalho # Date 1190671211 10800 # Node ID 4528858e7202d02c55c78e48eed18b76f6b71083 # Parent 7e6138cb8d387a02ff0346f3d2c0be90d2f41ab4 make identify an optionalrepo command Fixes issue726. diff --git a/mercurial/commands.py b/mercurial/commands.py --- 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: