Simplify backward compatible import kwmap-templates
authorChristian Ebert <blacktrash@gmx.net>
Fri, 20 Apr 2007 00:24:32 +0200
branchkwmap-templates
changeset 159 28fd5b5eb3ad
parent 158 900a9e4d7f82
child 160 e45d804d28dd
Simplify backward compatible import For an extension it's not worth the trouble to try for demandload.
hgkw/keyword.py
--- a/hgkw/keyword.py	Fri Mar 30 17:12:38 2007 +0200
+++ b/hgkw/keyword.py	Fri Apr 20 00:24:32 2007 +0200
@@ -85,17 +85,10 @@
      Header: /path/to/basename,v csetid %Y/%m/%d %H:%M:%S username
 '''
 
-try:
-    from mercurial.demandload import * # stable
-    from mercurial.i18n import gettext as _
-    demandload(globals(), 'mercurial:commands,fancyopts,templater,util')
-    demandload(globals(), 'mercurial:cmdutil,context,filelog')
-    demandload(globals(), 'os re sys time')
-except ImportError:                    # demandimport
-    from mercurial.i18n import _
-    from mercurial import commands, fancyopts, templater, util
-    from mercurial import cmdutil, context, filelog
-    import os, re, sys, time
+from mercurial.i18n import gettext as _
+from mercurial import commands, fancyopts, templater, util
+from mercurial import cmdutil, context, filelog
+import os, re, sys, time
 
 deftemplates = {
         'Revision': '{node|short}',