changeset 1857:848152a2e67f

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.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 08 Mar 2006 01:25:14 +0100
parents 5ac811b720de
children 9fab6e903bae
files mercurial/commands.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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'):