Just re-bin the node kwarg of the hook, instead of using changelog kwmap-templates
authorChristian Ebert <blacktrash@gmx.net>
Mon, 15 Jan 2007 19:41:18 +0100
branchkwmap-templates
changeset 100 4f1129ddbdb8
parent 99 f881ecdcdec9
child 101 98a65d978098
Just re-bin the node kwarg of the hook, instead of using changelog
hgkw/keyword.py
--- a/hgkw/keyword.py	Mon Jan 15 15:41:59 2007 +0100
+++ b/hgkw/keyword.py	Mon Jan 15 19:41:18 2007 +0100
@@ -43,6 +43,7 @@
 '''
 
 from mercurial import cmdutil, templater, util
+from mercurial.node import *
 import os.path, re, sys, time
 
 deftemplates = {
@@ -141,7 +142,7 @@
             data = super(kwfilelog, self).read(node)
             if self.iskwcandidate(data):
                 c = context.filectx(self._repo, self._path,
-                         fileid=node, filelog=self)
+                                    fileid=node, filelog=self)
                 return self.kwt.re_kw.sub(lambda m:
                         self.kwt.expand(m, self._path, node=c.node()), data)
             return data
@@ -196,7 +197,7 @@
     if not candidates:
         return
 
-    kwt = kwtemplater(ui, repo, node=repo.changelog.tip())
+    kwt = kwtemplater(ui, repo, node=bin(args['node']))
     for f in candidates:
         data = repo.wfile(f).read()
         if not util.binary(data):