Patchwork D7511: exchange: eliminate some bytes.format() calls

login
register
mail settings
Submitter phabricator
Date Nov. 23, 2019, 5:15 a.m.
Message ID <differential-rev-PHID-DREV-qnfkesywuie6pzdoy5mx-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43464/
State Superseded
Headers show

Comments

phabricator - Nov. 23, 2019, 5:15 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7511

AFFECTED FILES
  mercurial/exchange.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel
Yuya Nishihara - Nov. 24, 2019, 5:08 a.m.
>      if invalid_includes:
>          raise error.Abort(
> -            _(b"The following includes are not accessible for {}: {}").format(
> -                username, invalid_includes
> -            )
> +            _(b"The following includes are not accessible for %s: %s")
> +            % (username, invalid_includes)

Perhaps, `invalid_includes` is a list, and `b'%s' % a_list` is invalid on py3.
phabricator - Nov. 24, 2019, 5:16 a.m.
yuja added a comment.


  >   if invalid_includes:
  >       raise error.Abort(
  >
  > - _(b"The following includes are not accessible for {}: {}").format(
  > - username, invalid_includes
  > - )
  >
  > +            _(b"The following includes are not accessible for %s: %s")
  > +            % (username, invalid_includes)
  
  Perhaps, `invalid_includes` is a list, and `b'%s' % a_list` is invalid on py3.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7511/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7511

To: mharbison72, #hg-reviewers, dlax, indygreg
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -2181,9 +2181,8 @@ 
     )
     if not user_includes:
         raise error.Abort(
-            _(b"{} configuration for user {} is empty").format(
-                _NARROWACL_SECTION, username
-            )
+            _(b"%s configuration for user %s is empty")
+            % (_NARROWACL_SECTION, username)
         )
 
     user_includes = [
@@ -2202,9 +2201,8 @@ 
 
     if invalid_includes:
         raise error.Abort(
-            _(b"The following includes are not accessible for {}: {}").format(
-                username, invalid_includes
-            )
+            _(b"The following includes are not accessible for %s: %s")
+            % (username, invalid_includes)
         )
 
     new_args = {}