[PATCH] patch: define full messages for interactive record/revert

Anton Shestakov engored at ya.ru
Tue Jun 7 05:00:40 EDT 2016


07.06.2016, 16:39, "Denis Laxalde" <denis.laxalde at logilab.fr>:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde at logilab.fr>
> # Date 1465288639 -7200
> # Tue Jun 07 10:37:19 2016 +0200
> # Node ID 6727a55b29e931b6318c9227c68a39d7c77ece2d
> # Parent 1b3a0b0c414faa3d6d4dbcf4c5abbbe18aa9efd4
> patch: define full messages for interactive record/revert
>
> Followup 14eee72c8d52 to provide complete context for proper localization.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -3301,7 +3301,7 @@ def _performrevert(repo, parents, ctx, a
>          else:
>              diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
>          originalchunks = patch.parsepatch(diff)
> - operation = _('discard') if node == parent else _('revert')
> + operation = 'discard' if node == parent else 'revert'

Here are the first lines of cmdutil.recordfilter function for context:

def recordfilter(ui, originalhunks, operation=None):
    """ Prompts the user to filter the originalhunks and return a list of
    selected hunks.
    *operation* is used for ui purposes to indicate the user
    what kind of filtering they are doing: reverting, committing, shelving, etc.
    *operation* has to be a translated string.
    """

Does this patch change the requirement that operation has to be pre-translated?

(The docstring also mentions shelving, but I'm not sure how shelve uses recordfilter)


More information about the Mercurial-devel mailing list