summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrej Shadura <andrewsh@debian.org>2018-10-04 20:57:53 +0200
committerAndrej Shadura <andrewsh@debian.org>2018-10-04 20:57:53 +0200
commit77e4922e731003f2b96cb520b746cdbbe7251353 (patch)
tree3fd5d2cb708ef788c4cb6283fa1fee4a2cd9855b
parente34c4d4c02bad53d78b7c548065ad82ee28c9d1a (diff)
Import Upstream version 1.3.1
-rw-r--r--PKG-INFO2
-rw-r--r--mercurial_extension_utils.egg-info/PKG-INFO2
-rw-r--r--mercurial_extension_utils.py29
-rw-r--r--setup.py2
4 files changed, 23 insertions, 12 deletions
diff --git a/PKG-INFO b/PKG-INFO
index b8ecffb..8d32b94 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: mercurial_extension_utils
-Version: 1.3.0
+Version: 1.3.1
Summary: Mercurial Extension Utils
Home-page: http://bitbucket.org/Mekk/mercurial-extension_utils
Author: Marcin Kasperski
diff --git a/mercurial_extension_utils.egg-info/PKG-INFO b/mercurial_extension_utils.egg-info/PKG-INFO
index 5e0ad34..f6c8d67 100644
--- a/mercurial_extension_utils.egg-info/PKG-INFO
+++ b/mercurial_extension_utils.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: mercurial-extension-utils
-Version: 1.3.0
+Version: 1.3.1
Summary: Mercurial Extension Utils
Home-page: http://bitbucket.org/Mekk/mercurial-extension_utils
Author: Marcin Kasperski
diff --git a/mercurial_extension_utils.py b/mercurial_extension_utils.py
index d24267c..df08b7a 100644
--- a/mercurial_extension_utils.py
+++ b/mercurial_extension_utils.py
@@ -894,9 +894,17 @@ def command(cmdtable):
['othercmd', 'somecmd']
>>> cmdtable['othercmd'] # doctest: +ELLIPSIS
(<function othercmd at ...>, [('l', 'list', None, 'List widgets'), ('p', 'pagesize', 10, 'Page size')], 'othercmd [-l] [-p 20]')
+
+ Below is uninteresting test that it really works in various mecurials:
+
>>> from mercurial import commands
- >>> commands.norepo # doctest: +ELLIPSIS
+ >>> # Syntax changed in hg3.8, trying to accomodate
+ >>> commands.norepo if hasattr(commands, 'norepo') else ' othercmd' # doctest: +ELLIPSIS
'... othercmd'
+ >>> othercmd.__dict__['norepo'] if othercmd.__dict__ else True
+ True
+ >>> mycmd.__dict__['norepo'] if mycmd.__dict__ else False
+ False
"""
from mercurial import cmdutil, commands
@@ -949,14 +957,16 @@ def direct_import(module_name, blocked_modules=None):
>>> re.search("^(.)", "Ala").group(1)
'A'
- Allows to block some modules:
+ Allows to block some modules from demandimport machinery,
+ so they are not accidentally misloaded:
>>> k = direct_import("anydbm", ["dbhash", "gdbm", "dbm", "bsddb.db"])
>>> k.__name__
'anydbm'
:param module_name: name of imported module
- :param blocked_modules: names of modules to be blocked (list)
+ :param blocked_modules: names of modules to be blocked from demandimport
+ (list)
:return: imported module
"""
return direct_import_ext(module_name, blocked_modules)[0]
@@ -965,21 +975,22 @@ def direct_import(module_name, blocked_modules=None):
def direct_import_ext(module_name, blocked_modules=None):
"""
Like direct_import, but returns info whether module was just
- imported, or already loaded
+ imported, or already loaded.
- >>> m1, loaded = direct_import_ext("email.message")
+ >>> m1, loaded = direct_import_ext("xml.sax.handler")
>>> m1.__name__, loaded
- ('email.message', True)
+ ('xml.sax.handler', True)
- >>> m2, loaded = direct_import_ext("email.message")
+ >>> m2, loaded = direct_import_ext("xml.sax.handler")
>>> m2.__name__, loaded
- ('email.message', False)
+ ('xml.sax.handler', False)
>>> m1 == m2
True
:param module_name: name of imported module
- :param blocked_modules: names of modules to be blocked (list)
+ :param blocked_modules: names of modules to be blocked from
+ demandimport (list)
:return: (imported module, was-it-imported-now?)
"""
diff --git a/setup.py b/setup.py
index 4f93f29..11eda95 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
from setuptools import setup, find_packages
-VERSION = '1.3.0'
+VERSION = '1.3.1'
LONG_DESCRIPTION = open("README.txt").read()
INSTALL_REQUIRES = []