[PATCH] histedit: add support for exec/x command to histedit (issue4036)

timeless timeless at gmail.com
Thu Sep 10 17:25:44 CDT 2015


> +                    self.getinterventionmsg(
> +                        "Working copy dirty after exec %s" % self.cmd))

This produces a string with 'self.cmd' expanded (I believe cmd comes
from the user) and sends it here:

> +    def getinterventionmsg(self, errormsg):
> +        return _(errormsg + "\n" +
> +              'Make changes as needed, you may commit or record as needed '
> +              'now.\nWhen you are finished, run hg histedit --continue to '
> +              'resume.')

Here, errormsg is folded into a message which is then sent for translation.

The a not horribly incorrect approach would be:

self.getinterventionmsg(_("Working copy dirty after exec %s") % self.cmd)

 return _("%\n" +
              'Make changes as needed, you may commit or record as needed '
              'now.\nWhen you are finished, run hg histedit --continue to '
              'resume.' % errormsg)

Augie wrote:
> This construction *might* be bad for internationalization,

it is

> I'm not sure. Either way, you need to wrap the string here in _().


More information about the Mercurial-devel mailing list