[PATCH 2 of 2] py3: replace str.format(x) with `str % x` in githelp

Matt Harbison mharbison72 at gmail.com
Wed May 23 22:28:53 EDT 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1527128700 14400
#      Wed May 23 22:25:00 2018 -0400
# Node ID c3960c7e66fad7436f1a550ef1de693a635faa3a
# Parent  cfa93fbbe9b4ee98d66a7dc55cb0224c4cf03e9f
py3: replace str.format(x) with `str % x` in githelp

diff --git a/hgext/githelp.py b/hgext/githelp.py
--- a/hgext/githelp.py
+++ b/hgext/githelp.py
@@ -94,9 +94,9 @@ def parseoptions(ui, cmdoptions, args):
             try:
                 args.remove(flag)
             except Exception:
-                msg = _("unknown option '{0}' packed with other options")
-                hint = _("please try passing the option as its own flag: -{0}")
-                raise error.Abort(msg.format(ex.opt), hint=hint.format(ex.opt))
+                msg = _("unknown option '%s' packed with other options")
+                hint = _("please try passing the option as its own flag: -%s")
+                raise error.Abort(msg % ex.opt, hint=hint % ex.opt)
 
             ui.warn(_("ignoring unknown option %s\n") % flag)
 


More information about the Mercurial-devel mailing list