changeset 12497:5d00a35ea2ea

keyword: do not expand at all during diff Always shrink and never expand keywords during a diff operation. Avoid user distraction e.g. because of spurious differences appearing in the commit editor.
author Christian Ebert <blacktrash@gmx.net>
date Sun, 26 Sep 2010 19:18:41 +0200
parents 0b5d7da3bb78
children 4846e8cd9327
files hgext/keyword.py
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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():