Patchwork [5,of,5,stable] crecord: stop raising error.Abort if curses is not found (issue5008)

login
register
mail settings
Submitter Sean Farley
Date Dec. 16, 2015, 12:06 a.m.
Message ID <8fea1f66e5279a305b39.1450224376@laptop.office.atlassian.com>
Download mbox | patch
Permalink /patch/12065/
State Superseded
Commit 1be02894dd6fdc489b90c784456f82d8e7f95178
Delegated to: Laurent Charignon
Headers show

Comments

Sean Farley - Dec. 16, 2015, 12:06 a.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1450224243 28800
#      Tue Dec 15 16:04:03 2015 -0800
# Branch stable
# Node ID 8fea1f66e5279a305b39fded19ffbf4056a3bf9e
# Parent  23202dc041db998d6e2529b80dd4e7e4d4b4b040
crecord: stop raising error.Abort if curses is not found (issue5008)

On some servers, python curses support is disabled. This patch not only fixes
that but provides a fallback on other machines (e.g. Windows) when curses is
not found.
Laurent Charignon - Dec. 16, 2015, 5:21 a.m.
These 5 patches look good to me, thanks for doing that!

Laurent

On 12/15/15, 4:06 PM, "Mercurial-devel on behalf of Sean Farley"
<mercurial-devel-bounces@selenic.com on behalf of sean@farley.io> wrote:

># HG changeset patch
># User Sean Farley <sean@farley.io>
># Date 1450224243 28800
>#      Tue Dec 15 16:04:03 2015 -0800
># Branch stable
># Node ID 8fea1f66e5279a305b39fded19ffbf4056a3bf9e
># Parent  23202dc041db998d6e2529b80dd4e7e4d4b4b040
>crecord: stop raising error.Abort if curses is not found (issue5008)
>
>On some servers, python curses support is disabled. This patch not only
>fixes
>that but provides a fallback on other machines (e.g. Windows) when curses
>is
>not found.
>
>diff --git a/mercurial/crecord.py b/mercurial/crecord.py
>--- a/mercurial/crecord.py
>+++ b/mercurial/crecord.py
>@@ -46,13 +46,10 @@ except ImportError:
> # On windows, curses can throw a NameError, so check for that here
> try:
>     curses
> except NameError:
>     curses = False
>-    if os.name != 'nt':  # Temporary hack to get running on Windows again
>-        raise error.Abort(
>-            _('the python curses/wcurses module is not
>available/installed'))
> 
> def checkcurses(ui):
>     """Return True if the user wants to use curses
> 
>     This method returns True if curses is found (and that python is
>built with
>_______________________________________________
>Mercurial-devel mailing list
>Mercurial-devel@selenic.com
>https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -46,13 +46,10 @@  except ImportError:
 # On windows, curses can throw a NameError, so check for that here
 try:
     curses
 except NameError:
     curses = False
-    if os.name != 'nt':  # Temporary hack to get running on Windows again
-        raise error.Abort(
-            _('the python curses/wcurses module is not available/installed'))
 
 def checkcurses(ui):
     """Return True if the user wants to use curses
 
     This method returns True if curses is found (and that python is built with