mercurial/dispatch.py
changeset 17773 434e5bd615fc
parent 17299 e51d4aedace9
child 18224 0f9013112eba
--- a/mercurial/dispatch.py	Mon Oct 15 09:43:34 2012 -0700
+++ b/mercurial/dispatch.py	Tue Oct 16 11:43:15 2012 -0700
@@ -715,7 +715,8 @@
                 raise
             except error.RepoError:
                 if cmd not in commands.optionalrepo.split():
-                    if args and not path: # try to infer -R from command args
+                    if (cmd in commands.inferrepo.split() and
+                        args and not path): # try to infer -R from command args
                         repos = map(cmdutil.findrepo, args)
                         guess = repos[0]
                         if guess and repos.count(guess) == len(repos):