# HG changeset patch # User Thomas Arendsen Hein # Date 1141777514 -3600 # Node ID 848152a2e67fb96cd0b16272e483b329ca3b7897 # Parent 5ac811b720de4f4a34d058f42511c44d282eb3b9 Always try to open the repository if -R/--repository is specified. This makes 'hg -R something_unknown command' consistently fail for all commands, not only for those who need a repository. diff -r 5ac811b720de -r 848152a2e67f mercurial/commands.py --- a/mercurial/commands.py Wed Mar 08 00:27:23 2006 +0100 +++ b/mercurial/commands.py Wed Mar 08 01:25:14 2006 +0100 @@ -2844,6 +2844,13 @@ try: try: + path = options["repository"] + if path: + repo = hg.repository(u, path=path) + else: + repo = None + path = "" + if options['help']: help_(u, cmd, options['version']) sys.exit(0) @@ -2862,8 +2869,8 @@ (options['cwd'], inst.strerror)) if cmd not in norepo.split(): - path = options["repository"] or "" - repo = hg.repository(u, path=path) + if not repo: + repo = hg.repository(u, path=path) u = repo.ui for x in external: if hasattr(x, 'reposetup'):