# HG changeset patch # User Shun-ichi GOTO # Date 1156224716 -32400 # Node ID 985594e891b868ba159c00d73c2c0ace685cf6d2 # Parent eef469259745fdf3f198cc460e0a266e4823b4d6 Support foo@bar notation as demandload module spec. diff --git a/mercurial/packagescan.py b/mercurial/packagescan.py --- a/mercurial/packagescan.py +++ b/mercurial/packagescan.py @@ -25,6 +25,7 @@ def demandload(scope, modules): """ fake demandload function that collects the required modules foo import foo foo bar import foo, bar + foo@bar import foo as bar foo.bar import foo.bar foo:bar from foo import bar foo:bar,quux from foo import bar, quux @@ -38,6 +39,8 @@ def demandload(scope, modules): except: module = m fromlist = [] + if '@' in module: + module, as_ = module.split('@') mod = __import__(module, scope, scope, fromlist) if fromlist == []: # mod is only the top package, but we need all packages