Skip to content
Snippets Groups Projects
Commit 19379226dc67 authored by kiilerix's avatar kiilerix
Browse files

hg-ssh: use %s for printing paths in error messages

This avoids \\ if this ever is run on windows - for example in the test suite.
parent 54fc9796d75b
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@
try:
cmdargv = shlex.split(orig_cmd)
except ValueError, e:
sys.stderr.write("Illegal command %r: %s\n" % (orig_cmd, e))
sys.stderr.write('Illegal command "%s": %s\n' % (orig_cmd, e))
sys.exit(-1)
if cmdargv[:2] == ['hg', '-R'] and cmdargv[3:] == ['serve', '--stdio']:
......@@ -49,6 +49,6 @@
if repo in allowed_paths:
dispatch.dispatch(dispatch.request(['-R', repo, 'serve', '--stdio']))
else:
sys.stderr.write("Illegal repository %r\n" % repo)
sys.stderr.write('Illegal repository "%s"\n' % repo)
sys.exit(-1)
else:
......@@ -53,5 +53,5 @@
sys.exit(-1)
else:
sys.stderr.write("Illegal command %r\n" % orig_cmd)
sys.stderr.write('Illegal command "%s"\n' % orig_cmd)
sys.exit(-1)
......@@ -282,4 +282,5 @@
$ SSH_ORIGINAL_COMMAND="'hg' -R 'a repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP/a repo\"" "ssh://user@dummy/a repo"
3fb238f49e8c
$ SSH_ORIGINAL_COMMAND="'hg' -R 'a repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP\"" "ssh://user@dummy/a repo"
......@@ -285,4 +286,4 @@
$ SSH_ORIGINAL_COMMAND="'hg' -R 'a repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP\"" "ssh://user@dummy/a repo"
remote: Illegal repository '$TESTTMP/a repo' (glob)
remote: Illegal repository "$TESTTMP/a repo" (glob)
abort: no suitable response from remote hg!
[255]
......@@ -287,5 +288,6 @@
abort: no suitable response from remote hg!
[255]
$ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP\"" "ssh://user@dummy/a repo"
remote: Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
abort: no suitable response from remote hg!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment