Patchwork [2,of,2] crecord: use ui.interface to choose curses interface

login
register
mail settings
Submitter Simon Farnsworth
Date March 10, 2016, 7:47 p.m.
Message ID <ea0ec33267d78c832881.1457639258@SimonFar-MacBookPro.local>
Download mbox | patch
Permalink /patch/13744/
State Superseded
Commit f7874de435c5845509860f16d245e07997101353
Headers show

Comments

Simon Farnsworth - March 10, 2016, 7:47 p.m.
# HG changeset patch
# User Simon Farnsworth <simonfar@fb.com>
# Date 1457639167 0
#      Thu Mar 10 19:46:07 2016 +0000
# Node ID ea0ec33267d78c83288160a57056637e53fd2644
# Parent  77d0ac209cc8555d887b35313fad25e947aab7fa
crecord: use ui.interface to choose curses interface

use ui.interface to select curses mode, instead of experimental.crecord
Augie Fackler - March 16, 2016, 4:51 p.m.
On Thu, Mar 10, 2016 at 07:47:38PM +0000, Simon Farnsworth wrote:
> # HG changeset patch
> # User Simon Farnsworth <simonfar@fb.com>
> # Date 1457639167 0
> #      Thu Mar 10 19:46:07 2016 +0000
> # Node ID ea0ec33267d78c83288160a57056637e53fd2644
> # Parent  77d0ac209cc8555d887b35313fad25e947aab7fa
> crecord: use ui.interface to choose curses interface

I'm happy with these, queued. Thanks for going through the effort of 5 rounds!

>
> use ui.interface to select curses mode, instead of experimental.crecord
>
> diff --git a/mercurial/crecord.py b/mercurial/crecord.py
> --- a/mercurial/crecord.py
> +++ b/mercurial/crecord.py
> @@ -54,7 +54,7 @@
>      This method returns True if curses is found (and that python is built with
>      it) and that the user has the correct flag for the ui.
>      """
> -    return curses and ui.configbool('experimental', 'crecord', False)
> +    return curses and ui.interface("chunkselection") == "curses"
>
>  _origstdout = sys.__stdout__ # used by gethw()
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -54,7 +54,7 @@ 
     This method returns True if curses is found (and that python is built with
     it) and that the user has the correct flag for the ui.
     """
-    return curses and ui.configbool('experimental', 'crecord', False)
+    return curses and ui.interface("chunkselection") == "curses"
 
 _origstdout = sys.__stdout__ # used by gethw()