extensions: avoid shadowing imported module names with exthelper methods
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 02 Dec 2018 16:52:14 +0100
changeset 4284 f6298544d9d0
parent 4283 5c707b54f8b1
child 4285 69fb9e41ce2b
extensions: avoid shadowing imported module names with exthelper methods The previous code worked, but confused pyscripter.
hgext3rd/evolve/exthelper.py
--- a/hgext3rd/evolve/exthelper.py	Fri Nov 30 22:10:39 2018 -0500
+++ b/hgext3rd/evolve/exthelper.py	Sun Dec 02 16:52:14 2018 +0100
@@ -13,10 +13,10 @@
     commands,
     configitems,
     extensions,
-    fileset,
+    fileset as filesetmod,
     registrar,
-    revset,
-    templatekw,
+    revset as revsetmod,
+    templatekw as templatekwmod,
 )
 
 class exthelper(object):
@@ -136,13 +136,13 @@
         revsetpredicate = registrar.revsetpredicate()
         for name, symbol in self._revsetsymbols:
             revsetpredicate(name)(symbol)
-        revset.loadpredicate(ui, 'evolve', revsetpredicate)
+        revsetmod.loadpredicate(ui, 'evolve', revsetpredicate)
 
         filesetpredicate = registrar.filesetpredicate()
         for name, symbol in self._filesetsymbols:
             filesetpredicate(name)(symbol)
         # TODO: Figure out the calling extension name
-        fileset.loadpredicate(ui, 'exthelper', filesetpredicate)
+        filesetmod.loadpredicate(ui, 'exthelper', filesetpredicate)
 
         templatekeyword = registrar.templatekeyword()
         for name, kw, requires in self._templatekws:
@@ -150,7 +150,7 @@
                 templatekeyword(name, requires=requires)(kw)
             else:
                 templatekeyword(name)(kw)
-        templatekw.loadkeyword(ui, 'evolve', templatekeyword)
+        templatekwmod.loadkeyword(ui, 'evolve', templatekeyword)
 
         for ext, command, wrapper, opts in self._extcommandwrappers:
             if ext not in knownexts: