diff mercurial/dispatch.py @ 26142:7332bf4ae959

dispatch: error out on invalid -R path even if optionalrepo (issue4805) (BC) Before this patch, repo could be set to None for wrong -R. It's okay for commands that can reject repo=None, but the command server have a problem because: - it accepts repo=None for "unbound" mode - and it reenters dispatch() where repo object is created for cwd by default Test outputs are changed because the error is detected earlier. I think new message is better than ".hg not found".
author Yuya Nishihara <yuya@tcha.org>
date Mon, 31 Aug 2015 23:29:15 +0900
parents d491f289045f
children eb2187ebdf8a
line wrap: on
line diff
--- a/mercurial/dispatch.py	Tue Sep 01 16:38:52 2015 +0900
+++ b/mercurial/dispatch.py	Mon Aug 31 23:29:15 2015 +0900
@@ -890,6 +890,8 @@
             except error.RequirementError:
                 raise
             except error.RepoError:
+                if rpath and rpath[-1]: # invalid -R path
+                    raise
                 if cmd not in commands.optionalrepo.split():
                     if (cmd in commands.inferrepo.split() and
                         args and not path): # try to infer -R from command args