sparse: use named parameters in i18n strings
authorYuya Nishihara <yuya@tcha.org>
Sat, 04 Aug 2018 17:17:31 +0900
changeset 38862 1ff45c518e6f
parent 38861 49505ec24e8f
child 38863 61ab546b71c3
sparse: use named parameters in i18n strings This should give more hints about what the %s means, and allow reordering.
mercurial/sparse.py
--- 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)