hgext/keyword.py
changeset 12497 5d00a35ea2ea
parent 12496 0b5d7da3bb78
child 12498 4846e8cd9327
--- a/hgext/keyword.py	Sun Sep 26 19:18:41 2010 +0200
+++ b/hgext/keyword.py	Sun Sep 26 19:18:41 2010 +0200
@@ -517,12 +517,8 @@
 
     def kw_diff(orig, repo, node1=None, node2=None, match=None, changes=None,
                 opts=None, prefix=''):
-        '''Monkeypatch patch.diff to avoid expansion except when
-        comparing against working dir.'''
-        if node2 is not None:
-            kwt.match = util.never
-        elif node1 is not None and node1 != repo['.'].node():
-            kwt.restrict = True
+        '''Monkeypatch patch.diff to avoid expansion.'''
+        kwt.restrict = True
         return orig(repo, node1, node2, match, changes, opts, prefix)
 
     def kwweb_skip(orig, web, req, tmpl):
@@ -548,8 +544,7 @@
     repo.__class__ = kwrepo
 
     extensions.wrapfunction(patch.patchfile, '__init__', kwpatchfile_init)
-    if not kwt.restrict:
-        extensions.wrapfunction(patch, 'diff', kw_diff)
+    extensions.wrapfunction(patch, 'diff', kw_diff)
     for c in 'annotate changeset rev filediff diff'.split():
         extensions.wrapfunction(webcommands, c, kwweb_skip)
     for name in recordextensions.split():