mercurial/sshrepo.py
changeset 15622 86fc364ca5f8
parent 15581 d8fa35c28335
child 15624 be43234a6d60
--- a/mercurial/sshrepo.py	Wed Nov 16 15:29:57 2011 -0600
+++ b/mercurial/sshrepo.py	Thu Dec 08 16:39:00 2011 +0100
@@ -5,6 +5,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
+import re
 from i18n import _
 import util, error, wireproto
 
@@ -20,6 +21,8 @@
 
 def _serverquote(s):
     '''quote a string for the remote shell ... which we assume is sh'''
+    if re.match(r'[a-zA-Z0-9._\-/]*$', s):
+        return s
     return "'%s'" % s.replace("'", "'\\''")
 
 class sshrepository(wireproto.wirerepository):