# HG changeset patch # User Pierre-Yves David # Date 2021-04-15 22:16:43 # Node ID 9cc9b4a25248a5fe8265e7b9659077a9e0f8098a # Parent ba673c821b9d107a14b33dea7de6d93fd549dafd urlutil: provide some information about "bad url" when processing `pushurl` It appears pushurl only support `://` 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 diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -742,7 +742,9 @@ def pushurlpathoption(ui, path, value): u = url(value) # Actually require a URL. if not u.scheme: - ui.warn(_(b'(paths.%s:pushurl not a URL; ignoring)\n') % path.name) + msg = _(b'(paths.%s:pushurl not a URL; ignoring: "%s")\n') + msg %= (path.name, value) + ui.warn(msg) return None # Don't support the #foo syntax in the push URL to declare branch to diff --git a/tests/test-paths.t b/tests/test-paths.t --- a/tests/test-paths.t +++ b/tests/test-paths.t @@ -175,7 +175,7 @@ unknown sub-options aren't displayed > EOF $ hg paths - (paths.default:pushurl not a URL; ignoring) + (paths.default:pushurl not a URL; ignoring: "/not/a/url") default = /path/to/nothing #fragment is not allowed in :pushurl