changeset 41031:b53c5651fcf6

py3: convert `'{}'.format(foo)` to `'%s' % foo` in the bookflow extension Byte strings don't have the former. Converting these to byte strings is waiting on the mass rewrite.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 20 Dec 2018 23:16:58 -0500
parents c0865f3da285
children 9f06cd72cccb
files hgext/bookflow.py
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/bookflow.py	Thu Dec 20 18:12:29 2018 -0500
+++ b/hgext/bookflow.py	Thu Dec 20 23:16:58 2018 -0500
@@ -41,11 +41,11 @@
     if active:
         if active in ui.configlist(MY_NAME, 'protect'):
             raise error.Abort(
-                _('cannot commit, bookmark {} is protected').format(active))
+                _('cannot commit, bookmark %s is protected') % active)
         if not cwd_at_bookmark(repo, active):
             raise error.Abort(
        _('cannot commit, working directory out of sync with active bookmark'),
-                hint=_("run 'hg up {}'").format(active))
+                hint=_("run 'hg up %s'") % active)
     elif ui.configbool(MY_NAME, 'require-bookmark', True):
         raise error.Abort(_('cannot commit without an active bookmark'))
     return 0
@@ -64,9 +64,9 @@
         marks = repo._bookmarks
         for name in names:
             if name in marks:
-                raise error.Abort(
-                    _("bookmark {} already exists, to move use the --rev option"
-                    ).format(name))
+                raise error.Abort(_(
+                    "bookmark %s already exists, to move use the --rev option"
+                    ) % name)
     return orig(repo, tr, names, rev, force, inactive)
 
 def commands_commit(orig, ui, repo, *args, **opts):
@@ -78,8 +78,9 @@
     active = repo._bookmarks.active
     if active and not cwd_at_bookmark(repo, active):
         ui.warn(_(
-            "working directory out of sync with active bookmark, run 'hg up {}'"
-        ).format(active))
+            "working directory out of sync with active bookmark, run "
+            "'hg up %s'"
+        ) % active)
     return rc
 
 def commands_branch(orig, ui, repo, label=None, **opts):