[PATCH 4 of 8] demandimport: pass fromlist to original import function

Bryan O'Sullivan bos at serpentine.com
Wed Dec 23 00:24:42 CST 2015


# HG changeset patch
# User Bryan O'Sullivan <bos at serpentine.com>
# Date 1450849086 28800
#      Tue Dec 22 21:38:06 2015 -0800
# Node ID 030387dc5db0113c41a0b3b4ba72a118aa2bc84b
# Parent  84a069c3cf4bfcc56cd889a7c03ef974d3913b98
demandimport: pass fromlist to original import function

Without this, nested imports of the variety "from . import wibble" break.
But that bug is in turn hidden by the "if" clause immediately before,
which we will excise in the next commit.

diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py
--- a/mercurial/demandimport.py
+++ b/mercurial/demandimport.py
@@ -191,7 +191,8 @@ def _demandimport(name, globals=None, lo
                 return _hgextimport(_origimport, name, globals, locals,
                                     fromlist, level)
 
-            mod = _hgextimport(_origimport, name, globals, locals, level=level)
+            mod = _hgextimport(_origimport, name, globals, locals, fromlist,
+                               level)
 
             for x in fromlist:
                 processfromitem(mod, x)


More information about the Mercurial-devel mailing list