hgext/extdiff.py
changeset 4029 9210fba03d16
parent 4005 656e06eebda7
child 4096 49237d6ae97d
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -48,16 +48,15 @@
 # needed files, so running the external diff program will actually be
 # pretty fast (at least faster than having to compare the entire tree).
 
-from mercurial.demandload import demandload
-from mercurial.i18n import gettext as _
+from mercurial.i18n import _
 from mercurial.node import *
-demandload(globals(), 'mercurial:cmdutil,util os shutil tempfile')
+from mercurial import cmdutil, util
+import os, shutil, tempfile
 
 def dodiff(ui, repo, diffcmd, diffopts, pats, opts):
     def snapshot_node(files, node):
         '''snapshot files as of some revision'''
-        changes = repo.changelog.read(node)
-        mf = repo.manifest.read(changes[0])
+        mf = repo.changectx(node).manifest()
         dirname = '%s.%s' % (os.path.basename(repo.root), short(node))
         base = os.path.join(tmproot, dirname)
         os.mkdir(base)
@@ -74,7 +73,8 @@ def dodiff(ui, repo, diffcmd, diffopts, 
             destdir = os.path.dirname(dest)
             if not os.path.isdir(destdir):
                 os.makedirs(destdir)
-            repo.wwrite(wfn, repo.file(fn).read(mf[fn]), open(dest, 'w'))
+            data = repo.wwritedata(wfn, repo.file(wfn).read(mf[wfn]))
+            open(dest, 'w').write(data)
         return dirname
 
     def snapshot_wdir(files):