mercurial/posix.py
branchstable
changeset 24108 d65ecb814fc0
parent 23683 5edb387158a1
child 24594 609aa973c01d
equal deleted inserted replaced
24013:942a5a34b2d0 24108:d65ecb814fc0
   320     if os.sys.platform == 'OpenVMS':
   320     if os.sys.platform == 'OpenVMS':
   321         return '"%s"' % s
   321         return '"%s"' % s
   322     global _needsshellquote
   322     global _needsshellquote
   323     if _needsshellquote is None:
   323     if _needsshellquote is None:
   324         _needsshellquote = re.compile(r'[^a-zA-Z0-9._/-]').search
   324         _needsshellquote = re.compile(r'[^a-zA-Z0-9._/-]').search
   325     if not _needsshellquote(s):
   325     if s and not _needsshellquote(s):
   326         # "s" shouldn't have to be quoted
   326         # "s" shouldn't have to be quoted
   327         return s
   327         return s
   328     else:
   328     else:
   329         return "'%s'" % s.replace("'", "'\\''")
   329         return "'%s'" % s.replace("'", "'\\''")
   330 
   330