changeset 38862:1ff45c518e6f

sparse: use named parameters in i18n strings This should give more hints about what the %s means, and allow reordering.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 04 Aug 2018 17:17:31 +0900
parents 49505ec24e8f
children 61ab546b71c3
files mercurial/sparse.py
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sparse.py	Sat Aug 04 17:11:03 2018 +0900
+++ b/mercurial/sparse.py	Sat Aug 04 17:17:31 2018 +0900
@@ -56,8 +56,8 @@
         elif line == '[include]':
             if havesection and current != includes:
                 # TODO pass filename into this API so we can report it.
-                raise error.Abort(_('%s config cannot have includes '
-                                    'after excludes') % action)
+                raise error.Abort(_('%(action)s config cannot have includes '
+                                    'after excludes') % {'action': action})
             havesection = True
             current = includes
             continue
@@ -66,15 +66,16 @@
             current = excludes
         elif line:
             if current is None:
-                raise error.Abort(_('%s config entry outside of '
-                                    'section: %s') % (action, line),
+                raise error.Abort(_('%(action)s config entry outside of '
+                                    'section: %(line)s')
+                                  % {'action': action, 'line': line},
                                   hint=_('add an [include] or [exclude] line '
                                          'to declare the entry type'))
 
             if line.strip().startswith('/'):
-                ui.warn(_('warning: %s profile cannot use'
-                          ' paths starting with /, ignoring %s\n')
-                        % (action, line))
+                ui.warn(_('warning: %(action)s profile cannot use'
+                          ' paths starting with /, ignoring %(line)s\n')
+                        % {'action': action, 'line': line})
                 continue
             current.add(line)