##// END OF EJS Templates
hg-ssh: use %s for printing paths in error messages...
Mads Kiilerich -
r16606:19379226 stable
parent child Browse files
Show More
@@ -40,7 +40,7 b" orig_cmd = os.getenv('SSH_ORIGINAL_COMMA"
40 try:
40 try:
41 cmdargv = shlex.split(orig_cmd)
41 cmdargv = shlex.split(orig_cmd)
42 except ValueError, e:
42 except ValueError, e:
43 sys.stderr.write("Illegal command %r: %s\n" % (orig_cmd, e))
43 sys.stderr.write('Illegal command "%s": %s\n' % (orig_cmd, e))
44 sys.exit(-1)
44 sys.exit(-1)
45
45
46 if cmdargv[:2] == ['hg', '-R'] and cmdargv[3:] == ['serve', '--stdio']:
46 if cmdargv[:2] == ['hg', '-R'] and cmdargv[3:] == ['serve', '--stdio']:
@@ -49,9 +49,9 b" if cmdargv[:2] == ['hg', '-R'] and cmdar"
49 if repo in allowed_paths:
49 if repo in allowed_paths:
50 dispatch.dispatch(dispatch.request(['-R', repo, 'serve', '--stdio']))
50 dispatch.dispatch(dispatch.request(['-R', repo, 'serve', '--stdio']))
51 else:
51 else:
52 sys.stderr.write("Illegal repository %r\n" % repo)
52 sys.stderr.write('Illegal repository "%s"\n' % repo)
53 sys.exit(-1)
53 sys.exit(-1)
54 else:
54 else:
55 sys.stderr.write("Illegal command %r\n" % orig_cmd)
55 sys.stderr.write('Illegal command "%s"\n' % orig_cmd)
56 sys.exit(-1)
56 sys.exit(-1)
57
57
@@ -282,10 +282,12 b' Test hg-ssh:'
282
282
283 $ 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"
283 $ 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"
284 3fb238f49e8c
284 3fb238f49e8c
285
285 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP\"" "ssh://user@dummy/a repo"
286 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP\"" "ssh://user@dummy/a repo"
286 remote: Illegal repository '$TESTTMP/a repo' (glob)
287 remote: Illegal repository "$TESTTMP/a repo" (glob)
287 abort: no suitable response from remote hg!
288 abort: no suitable response from remote hg!
288 [255]
289 [255]
290
289 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP\"" "ssh://user@dummy/a repo"
291 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" hg id --ssh "python \"$TESTDIR\"/../contrib/hg-ssh \"$TESTTMP\"" "ssh://user@dummy/a repo"
290 remote: Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
292 remote: Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
291 abort: no suitable response from remote hg!
293 abort: no suitable response from remote hg!
General Comments 0
You need to be logged in to leave comments. Login now