[PATCH 3 of 5 V2] ui: change flag for curses interface to ui.curses

Augie Fackler raf at durin42.com
Fri May 29 16:01:14 CDT 2015


On Fri, May 29, 2015 at 10:29:59AM -0700, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1432850639 25200
> #      Thu May 28 15:03:59 2015 -0700
> # Node ID 2a54d1ceebeac71129f211be67fc2876d01674c2
> # Parent  9e29b782004467e1837c6ddae7091afeda50e485
> ui: change flag for curses interface to ui.curses
>
> Before this patch the flag for the curses interface was experimental.crecord.
> Since this is a ui feature that is no longer experimental we change the config
> flag to ui.curses. We don't have to worry about retrocompatibility as the
> feature was experimental.

This seems wrong now.

>
> diff --git a/hgext/record.py b/hgext/record.py
> --- a/hgext/record.py
> +++ b/hgext/record.py
> @@ -54,9 +54,9 @@
>      This command is not available when committing a merge.'''
>
>      opts["interactive"] = True
> -    backup = ui.backupconfig('experimental', 'crecord')
> +    backup = ui.backupconfig('ui', 'curses')

This hunk is at best misplaced? It definitely won't work as expected until a few patches later.

>      try:
> -        ui.setconfig('experimental', 'crecord', False, 'record')
> +        ui.setconfig('ui', 'curses', False, 'record')
>          commands.commit(ui, repo, *pats, **opts)
>      finally:
>          ui.restoreconfig(backup)
> @@ -101,9 +101,9 @@
>          opts['checkname'] = False
>          mq.new(ui, repo, patch, *pats, **opts)
>
> -    backup = ui.backupconfig('experimental', 'crecord')
> +    backup = ui.backupconfig('ui', 'curses')
>      try:
> -        ui.setconfig('experimental', 'crecord', False, 'record')
> +        ui.setconfig('ui', 'curses', False, 'record')
>          cmdutil.dorecord(ui, repo, committomq, 'qnew', False,
>                           cmdutil.recordfilter, *pats, **opts)
>      finally:
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -644,8 +644,8 @@
>
>          Interactive commands can use the curses recording interface.
>          To have curses a UI needs to be interactive and have the flag
> -        experimental.crecord set to True'''
> -        i = self.configbool("experimental", "crecord", None)
> +        ui.curses set to True'''
> +        i = self.configbool("ui", "curses", None)
>          return self.interactive() and i
>
>      def termwidth(self):
> diff --git a/tests/test-commit-interactive-curses.t b/tests/test-commit-interactive-curses.t
> --- a/tests/test-commit-interactive-curses.t
> +++ b/tests/test-commit-interactive-curses.t
> @@ -3,8 +3,8 @@
>    $ cat <<EOF >> $HGRCPATH
>    > [ui]
>    > interactive = true
> +  > curses = true
>    > [experimental]
> -  > crecord = true
>    > crecordtest = testModeCommands
>    > EOF
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list