comparison mercurial/util.py @ 36724:ca201470abb4

util: fix unsafe url abort with bytestr() on url Differential Revision: https://phab.mercurial-scm.org/D2669
author Augie Fackler <augie@google.com>
date Sun, 04 Mar 2018 15:55:55 -0500
parents d77c3b023393
children ffa3026d4196
comparison
equal deleted inserted replaced
36723:1f9bbd1d6b8a 36724:ca201470abb4
3095 Raises an error.Abort when the url is unsafe. 3095 Raises an error.Abort when the url is unsafe.
3096 """ 3096 """
3097 path = urlreq.unquote(path) 3097 path = urlreq.unquote(path)
3098 if path.startswith('ssh://-') or path.startswith('svn+ssh://-'): 3098 if path.startswith('ssh://-') or path.startswith('svn+ssh://-'):
3099 raise error.Abort(_('potentially unsafe url: %r') % 3099 raise error.Abort(_('potentially unsafe url: %r') %
3100 (path,)) 3100 (pycompat.bytestr(path),))
3101 3101
3102 def hidepassword(u): 3102 def hidepassword(u):
3103 '''hide user credential in a url string''' 3103 '''hide user credential in a url string'''
3104 u = url(u) 3104 u = url(u)
3105 if u.passwd: 3105 if u.passwd: