Patchwork [1,of,2] extensions: fix a debug message when searching for extensions

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 29, 2016, 10:41 p.m.
Message ID <3be12e323bde3e199c72.1475188862@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/16806/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 29, 2016, 10:41 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1475187915 -7200
#      Fri Sep 30 00:25:15 2016 +0200
# Node ID 3be12e323bde3e199c72b10e101487bc7957fdfd
# Parent  ff17dff99295e0781b3f147da2c5e5b14d3436e4
# EXP-Topic extensions.debug
extensions: fix a debug message when searching for extensions

The "next" value was wrong. When 'hgext.NAME' is not found we now search for
'hgext3rd.NAME'.
Yuya Nishihara - Sept. 30, 2016, 1:30 p.m.
On Fri, 30 Sep 2016 00:41:02 +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1475187915 -7200
> #      Fri Sep 30 00:25:15 2016 +0200
> # Node ID 3be12e323bde3e199c72b10e101487bc7957fdfd
> # Parent  ff17dff99295e0781b3f147da2c5e5b14d3436e4
> # EXP-Topic extensions.debug
> extensions: fix a debug message when searching for extensions

Looks good, queued these, thanks.

Patch

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -105,7 +105,7 @@  def load(ui, name, path):
         try:
             mod = _importh("hgext.%s" % name)
         except ImportError as err:
-            _reportimporterror(ui, err, "hgext.%s" % name, name)
+            _reportimporterror(ui, err, "hgext.%s" % name, "hgext3rd.%s" % name)
             try:
                 mod = _importh("hgext3rd.%s" % name)
             except ImportError as err:
diff --git a/tests/test-bad-extension.t b/tests/test-bad-extension.t
--- a/tests/test-bad-extension.t
+++ b/tests/test-bad-extension.t
@@ -53,7 +53,7 @@  show traceback for ImportError of hgext.
   *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
   Traceback (most recent call last):
   Exception: bit bucket overflow
-  could not import hgext.badext2 (No module named *badext2): trying badext2 (glob)
+  could not import hgext.badext2 (No module named *badext2): trying hgext3rd.badext2 (glob)
   Traceback (most recent call last):
   ImportError: No module named *badext2 (glob)
   could not import hgext3rd.badext2 (No module named *badext2): trying badext2 (glob)