sshrepo: add more safe characters (
issue2983)
Extended the list of safe characters introduced in
86fc364ca5f8 to include
everything from pipes._safechars, which is only available on Unix platforms.
Place "-" at the end of the range to avoid backslash-escape.
New characters: @%+=:,
--- a/mercurial/sshrepo.py Thu Dec 08 16:01:44 2011 -0600
+++ b/mercurial/sshrepo.py Fri Dec 09 15:50:33 2011 +0100
@@ -21,7 +21,7 @@
def _serverquote(s):
'''quote a string for the remote shell ... which we assume is sh'''
- if re.match(r'[a-zA-Z0-9._\-/]*$', s):
+ if re.match('[a-zA-Z0-9@%_+=:,./-]*$', s):
return s
return "'%s'" % s.replace("'", "'\\''")