[PATCH 2 of 3] record: add default value for operation argument

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed May 27 22:20:02 CDT 2015



On 05/27/2015 04:43 PM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1432767370 25200
> #      Wed May 27 15:56:10 2015 -0700
> # Node ID 6960203e25ebccc2f1588bc62aaa75638ee3545f
> # Parent  99386da5b5499f7480f59d898ce46363bf9d6342
> record: add default value for operation argument
>
> This patch is part of a series of patches to change the recording ui to reflect
> the operation currently running (commit, shelve, revert ...).
> This patch adds the default value of the operation argument for record's
> standard and curses interface to match what is displayed in the interface
> as of today.

I've taken this patch too.

>
> diff --git a/mercurial/crecord.py b/mercurial/crecord.py
> --- a/mercurial/crecord.py
> +++ b/mercurial/crecord.py
> @@ -428,6 +428,8 @@
>   def filterpatch(ui, chunks, chunkselector, operation=None):
>       """interactively filter patch chunks into applied-only chunks"""
>
> +    if operation is None:
> +        operation = 'confirm'
>       chunks = list(chunks)
>       # convert chunks list into structure suitable for displaying/modifying
>       # with curses.  create a list of headers only.
> diff --git a/mercurial/patch.py b/mercurial/patch.py
> --- a/mercurial/patch.py
> +++ b/mercurial/patch.py
> @@ -950,6 +950,8 @@
>
>   def filterpatch(ui, headers, operation=None):
>       """Interactively filter patch chunks into applied-only chunks"""
> +    if operation is None:
> +        operation = 'record'

I agree with the eventual goal of this work of cleaning up our wording 
in all our interactive UI. If all our commands slowly gain interractive 
capability, users needs to be able to know what operation he is looking 
at. Especially since 'record' is a darc-ism that does not mean much in 
the Mercurial world.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list