Patchwork dispatch: use the right context manager to deactivate demandimport

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Sept. 13, 2015, 8:44 p.m.
Message ID <2e42517129caca9bcf44.1442177082@Iris>
Download mbox | patch
Permalink /patch/10497/
State Accepted
Headers show

Comments

Jordi Gutiérrez Hermoso - Sept. 13, 2015, 8:44 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1442176221 14400
#      Sun Sep 13 16:30:21 2015 -0400
# Node ID 2e42517129caca9bcf4420e6f466f2205af22d43
# Parent  6c962145f523e6e0ed1c94eb6764bf198a92917b
dispatch: use the right context manager to deactivate demandimport

In e86d12404d69 I very embarrassingly wrote a patch with the
completely wrong function name. This should fix it.
Augie Fackler - Sept. 14, 2015, 2:28 a.m.
On Sun, Sep 13, 2015 at 04:44:42PM -0400, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1442176221 14400
> #      Sun Sep 13 16:30:21 2015 -0400
> # Node ID 2e42517129caca9bcf4420e6f466f2205af22d43
> # Parent  6c962145f523e6e0ed1c94eb6764bf198a92917b
> dispatch: use the right context manager to deactivate demandimport

Queued, thanks. Sorry I missed this in review.

>
> In e86d12404d69 I very embarrassingly wrote a patch with the
> completely wrong function name. This should fix it.
>
> diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
> --- a/mercurial/dispatch.py
> +++ b/mercurial/dispatch.py
> @@ -181,7 +181,7 @@ def _runcatch(req):
>                      debugtrace[debugger] == debugtrace['pdb']):
>                      ui.warn(_("%s debugger specified "
>                                "but its module was not found\n") % debugger)
> -                with demandimport.disabled():
> +                with demandimport.deactivated():
>                      debugtrace[debugger]()
>              try:
>                  return _dispatch(req)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -181,7 +181,7 @@  def _runcatch(req):
                     debugtrace[debugger] == debugtrace['pdb']):
                     ui.warn(_("%s debugger specified "
                               "but its module was not found\n") % debugger)
-                with demandimport.disabled():
+                with demandimport.deactivated():
                     debugtrace[debugger]()
             try:
                 return _dispatch(req)