# HG changeset patch # User Matt Harbison # Date 1618455041 14400 # Node ID 93c224dc099b6585f72df95a52d7d90226bb9cf0 # Parent cdbef062c6c8a2409caf0d22d75e0f08ff4758fb urlutil: use bytes for Abort messages Caught by pytype. Also fix a minor grammar issue in the second message. Differential Revision: https://phab.mercurial-scm.org/D10433 diff -r cdbef062c6c8 -r 93c224dc099b mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py Thu Apr 08 16:41:13 2021 +0200 +++ b/mercurial/utils/urlutil.py Wed Apr 14 22:50:41 2021 -0400 @@ -643,11 +643,11 @@ try: subpath = paths[self.url.host] except KeyError: - m = _('cannot use `%s`, "%s" is not a known path') + m = _(b'cannot use `%s`, "%s" is not a known path') m %= (self.rawloc, self.url.host) raise error.Abort(m) if subpath.raw_url.scheme == b'path': - m = _('cannot use `%s`, "%s" is also define as a `path://`') + m = _(b'cannot use `%s`, "%s" is also defined as a `path://`') m %= (self.rawloc, self.url.host) raise error.Abort(m) self.url = subpath.url diff -r cdbef062c6c8 -r 93c224dc099b tests/test-paths.t --- a/tests/test-paths.t Thu Apr 08 16:41:13 2021 +0200 +++ b/tests/test-paths.t Wed Apr 14 22:50:41 2021 -0400 @@ -348,10 +348,10 @@ $ hg id 000000000000 $ hg path - abort: cannot use `path://other_default`, "other_default" is also define as a `path://` + abort: cannot use `path://other_default`, "other_default" is also defined as a `path://` [255] $ hg pull chain_path - abort: cannot use `path://other_default`, "other_default" is also define as a `path://` + abort: cannot use `path://other_default`, "other_default" is also defined as a `path://` [255] Doing an actual circle should always be an issue @@ -365,10 +365,10 @@ $ hg id 000000000000 $ hg path - abort: cannot use `path://other_default`, "other_default" is also define as a `path://` + abort: cannot use `path://other_default`, "other_default" is also defined as a `path://` [255] $ hg pull chain_path - abort: cannot use `path://other_default`, "other_default" is also define as a `path://` + abort: cannot use `path://other_default`, "other_default" is also defined as a `path://` [255] Test basic error cases