Merge with stable
authorChristian Ebert <blacktrash@gmx.net>
Wed, 13 Oct 2010 09:21:19 +0100
changeset 841 a6865ff86aaf
parent 838 c793c1a87f1c (current diff)
parent 840 df93d61a7790 (diff)
child 842 12f6e285e4e7
Merge with stable
--- a/hgkw/keyword.py	Tue Oct 12 16:29:32 2010 +0100
+++ b/hgkw/keyword.py	Wed Oct 13 09:21:19 2010 +0100
@@ -82,7 +82,7 @@
 {desc}" expands to the first line of the changeset description.
 '''
 
-from mercurial import commands, cmdutil, dispatch, filelog, extensions
+from mercurial import commands, context, cmdutil, dispatch, filelog, extensions
 from mercurial import localrepo, match, patch, templatefilters, templater, util
 from mercurial.hgweb import webcommands
 from mercurial.i18n import _
@@ -591,6 +591,12 @@
 
     repo.__class__ = kwrepo
 
+    def kwfilectx_cmp(orig, self, fctx):
+        # keyword affects data size, comparing wdir and filelog size does
+        # not make sense
+        return self._filelog.cmp(self._filenode, fctx.data())
+    extensions.wrapfunction(context.filectx, 'cmp', kwfilectx_cmp)
+
     extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init)
     extensions.wrapfunction(patch, 'diff', kw_diff)
     extensions.wrapfunction(cmdutil, 'copy', kw_copy)