[PATCH 1 of 2 v3] merge: use labels in prompts to the user

Yuya Nishihara yuya at tcha.org
Thu Aug 11 07:02:31 EDT 2016


On Wed, 10 Aug 2016 09:44:40 -0700, Simon Farnsworth wrote:
> # HG changeset patch
> # User Simon Farnsworth <simonfar at fb.com>
> # Date 1470844060 25200
> #      Wed Aug 10 08:47:40 2016 -0700
> # Node ID 3c3951be4eaa964974ffd9722d4d34fe7ba595a1
> # Parent  37b6f0ec6241a62de90737409458cd622e2fac0d
> merge: use labels in prompts to the user

>              index = ui.promptchoice(
> -                _("no tool found to merge %s\n"
> -                  "keep (l)ocal, take (o)ther, or leave (u)nresolved?"
> -                  "$$ &Local $$ &Other $$ &Unresolved") % fd, 2)
> +                _("no tool found to merge %(fd)s\n"
> +                  "keep %(localact)s, take %(otheract)s, or leave (u)nresolved?"
> +                  "$$ &Local $$ &Other $$ &Unresolved") % prompts, 2)

[snip]

> +def partnames(labels):
> +    """Return a dictionary of merge part names for use in prompts to the user
> +
> +    These names include labels if supplied"""
> +    if labels is None:
> +        return {
> +            "local": _("local"),
> +            "other": _("other"),
> +            "remote": _("remote"),
> +            "localact": _("(l)ocal"),
> +            "otheract": _("(o)ther"),
> +        }

"(l)ocal" and "$$ &Local" must be translated at a time. That's why we have
$$ notation.

https://selenic.com/repo/hg/rev/c58b6ab4c26f


More information about the Mercurial-devel mailing list