[PATCH V4] record: make hg record always use the non curses interface

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri May 15 14:41:32 CDT 2015



On 05/14/2015 07:46 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1431574212 25200
> #      Wed May 13 20:30:12 2015 -0700
> # Node ID 6646328ce93ff8071ad87f68ee7320759b7a1144
> # Parent  7c324f65e4efb3310f7664df3da94363bef76765
> record: make hg record always use the non curses interface
>
> Before this patch, hg record was running hg commit -i, therefore with the
> experimental.crecord=True flag, hg record was actually launching the curses
> record interface. Some of our users could be confused by that.
> This patch makes the hg record command set this flag to False, ensuring that
> hg record never shows the curses interface.
> commit -i, shelve -i and revert -i remain unchanged and use the curses
> interface if the experimental.crecord flag is set.
>
> diff --git a/hgext/record.py b/hgext/record.py
> --- a/hgext/record.py
> +++ b/hgext/record.py
> @@ -50,7 +50,12 @@
>       This command is not available when committing a merge.'''
>
>       opts["interactive"] = True
> -    commands.commit(ui, repo, *pats, **opts)
> +    backup = ui.backupconfig('experimental', 'crecord')
> +    try:
> +        ui.setconfig('experimental', 'crecord', False, 'record')
> +        commands.commit(ui, repo, *pats, **opts)
> +    finally:
> +        ui.restoreconfig(backup)
>
>   def qrefresh(origfn, ui, repo, *pats, **opts):
>       if not opts['interactive']:
> @@ -66,8 +71,13 @@
>           mq.refresh(ui, repo, **opts)
>
>       # backup all changed files
> -    cmdutil.dorecord(ui, repo, committomq, 'qrefresh', True,
> +    backup = ui.backupconfig('experimental', 'crecord')
> +    try:
> +        ui.setconfig('experimental', 'crecord', False, 'record')
> +        cmdutil.dorecord(ui, repo, committomq, 'qrefresh', True,
>                       cmdutil.recordfilter, *pats, **opts)
> +    finally:
> +        ui.restoreconfig(backup)

I do not think we should enforce the old UI on 'qrefresh -i' forcing it 
on 'qrecord' if we force it on 'crecord' make sense, but forcing it on 
'qrefresh -i' if we do not force it on 'commit -i' (and we do not want 
to force it imho) does not make too much sense.

If you agree I'll drop this hunk and push the patch.


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list