comparison mercurial/utils/urlutil.py @ 47276:9cc9b4a25248

urlutil: provide some information about "bad url" when processing `pushurl` It appears pushurl only support `<proto>://` entries. This is not obvious and can lead to obscure error. We make the error less obscure as a start.. Differential Revision: https://phab.mercurial-scm.org/D10455
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 16 Apr 2021 00:16:43 +0200
parents 834f4e9d1af2
children 65333ecc8b34
comparison
equal deleted inserted replaced
47275:ba673c821b9d 47276:9cc9b4a25248
740 @pathsuboption(b'pushurl', b'pushloc') 740 @pathsuboption(b'pushurl', b'pushloc')
741 def pushurlpathoption(ui, path, value): 741 def pushurlpathoption(ui, path, value):
742 u = url(value) 742 u = url(value)
743 # Actually require a URL. 743 # Actually require a URL.
744 if not u.scheme: 744 if not u.scheme:
745 ui.warn(_(b'(paths.%s:pushurl not a URL; ignoring)\n') % path.name) 745 msg = _(b'(paths.%s:pushurl not a URL; ignoring: "%s")\n')
746 msg %= (path.name, value)
747 ui.warn(msg)
746 return None 748 return None
747 749
748 # Don't support the #foo syntax in the push URL to declare branch to 750 # Don't support the #foo syntax in the push URL to declare branch to
749 # push. 751 # push.
750 if u.fragment: 752 if u.fragment: