Throw out demandimport -- at least temporarily updatehook
authorChristian Ebert <blacktrash@gmx.net>
Sun, 17 Dec 2006 10:52:47 +0100
branchupdatehook
changeset 24 1083d250d1b2
parent 23 9fdf507badfc
child 25 aa3fbe81e9ad
Throw out demandimport -- at least temporarily
hgkw/kwexpander.py
--- a/hgkw/kwexpander.py	Sun Dec 17 10:16:16 2006 +0100
+++ b/hgkw/kwexpander.py	Sun Dec 17 10:52:47 2006 +0100
@@ -1,10 +1,8 @@
 # $Hg$
 
-from mercurial import demandimport
-demandimport.enable()
-
 from mercurial.i18n import _
-import mercurial.util, re
+from mercurial import util
+import re
 
 # name of keyword encode filter:
 kwencodefilter = 'hgkwencode'
@@ -16,7 +14,7 @@
     ui.note(_('expanding keywords in %s\n' % f))
 #   # backup file (?)
 #   absfile = repo.wjoin(f)
-#   mercurial.util.copyfile(absfile, absfile+'.kwbak')
+#   util.copyfile(absfile, absfile+'.kwbak')
     repo.wfile(f, 'w').write(text)
 
 def expandkw(ui, repo, node, cid, candidates, update=False):
@@ -27,7 +25,7 @@
     # python2.4: files = set()
     for pat, cmd in repo.ui.configitems('encode'):
         if cmd.endswith(kwencodefilter):
-            mf = mercurial.util.matcher(repo.root, '', [pat], [], [])[1]
+            mf = util.matcher(repo.root, '', [pat], [], [])[1]
             for candidate in candidates:
                 if mf(candidate) and candidate not in files:
                     files.append(candidate)
@@ -38,10 +36,9 @@
         return False
 
     user, date = repo.changelog.read(node)[1:3]
-    user = mercurial.util.shortuser(user)
-    date = mercurial.util.datestr(date=date,
-            format=mercurial.util.defaultdateformats[2])
-                                  # %Y-%m-%d %H:%M
+    user = util.shortuser(user)
+    date = util.datestr(date=date, format=util.defaultdateformats[2])
+                                               # %Y-%m-%d %H:%M
 
     # collect filenames that were changed by hg update
     kwupdates = []