Patchwork D10872: urlutil: byteify several localized messages

login
register
mail settings
Submitter phabricator
Date June 12, 2021, 4:57 a.m.
Message ID <differential-rev-PHID-DREV-s56kkripftygxyqrhts7-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49193/
State Superseded
Headers show

Comments

phabricator - June 12, 2021, 4:57 a.m.
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

Patch

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]