# HG changeset patch # User Christian Ebert # Date 1285521521 -7200 # Node ID 5d00a35ea2eaf514e6ae2acc5f1a86fbee92d06e # Parent 0b5d7da3bb785a55a20a98fa28d74bd7a670e547 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. diff -r 0b5d7da3bb78 -r 5d00a35ea2ea hgext/keyword.py --- 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():