From patchwork Sat Jun 12 04:57:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10872: urlutil: byteify several localized messages From: phabricator X-Patchwork-Id: 49193 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 12 Jun 2021 04:57:01 +0000 mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Flagged by pytype. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10872 AFFECTED FILES mercurial/utils/urlutil.py CHANGE DETAILS To: mharbison72, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -538,10 +538,12 @@ dests = list(get_push_paths(repo, ui, dests)) if len(dests) != 1: if dest is None: - msg = _("default path points to %d urls while %s only supports one") + msg = _( + b"default path points to %d urls while %s only supports one" + ) msg %= (len(dests), action) else: - msg = _("path points to %d urls while %s only supports one: %s") + msg = _(b"path points to %d urls while %s only supports one: %s") msg %= (len(dests), action, dest) raise error.Abort(msg) return dests[0] @@ -577,10 +579,12 @@ urls.append(source) if len(urls) != 1: if source is None: - msg = _("default path points to %d urls while %s only supports one") + msg = _( + b"default path points to %d urls while %s only supports one" + ) msg %= (len(urls), action) else: - msg = _("path points to %d urls while %s only supports one: %s") + msg = _(b"path points to %d urls while %s only supports one: %s") msg %= (len(urls), action, source) raise error.Abort(msg) return parseurl(urls[0], default_branches) @@ -609,11 +613,11 @@ if len(urls) != 1: if source is None: msg = _( - "default path points to %d urls while only one is supported" + b"default path points to %d urls while only one is supported" ) msg %= len(urls) else: - msg = _("path points to %d urls while only one is supported: %s") + msg = _(b"path points to %d urls while only one is supported: %s") msg %= (len(urls), source) raise error.Abort(msg) url = urls[0]