sshrepo: add more safe characters (issue2983)
authorThomas Arendsen Hein <thomas@intevation.de>
Fri, 09 Dec 2011 15:50:33 +0100
changeset 15624 be43234a6d60
parent 15623 fc8c7a5ccc4a
child 15625 efdcce3fd2d5
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: @%+=:,
mercurial/sshrepo.py
--- 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("'", "'\\''")