[PATCH 1 of 5 V2] ui: add function to query availability of the curses ui

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Jun 1 03:45:08 CDT 2015



On 05/29/2015 10:29 AM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1432850427 25200
> #      Thu May 28 15:00:27 2015 -0700
> # Node ID d3d3b39531589929cf1bcf24ce04a596db1f4a6f
> # Parent  6ac860f700b5cfeda232d5305963047696b869ca
> ui: add function to query availability of the curses ui
>
> Before this patch, whenever we wanted to check if the curses ui was enabled
> we had to check the config flag directly. This patch introduces a method for
> checking the flag.
>
> diff --git a/mercurial/ui.py b/mercurial/ui.py
> --- a/mercurial/ui.py
> +++ b/mercurial/ui.py
> @@ -639,6 +639,15 @@
>
>           return i
>
> +    def curses(self):
> +        '''is curses ui allowed?
> +
> +        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)
> +        return self.interactive() and i

I'm not sure why 'interactive' sneak in there. Can you elaborate?

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list