[PATCH 3 of 4] keyword: do not expand at all during diff
Christian Ebert
blacktrash at gmx.net
Sun Sep 26 12:19:09 CDT 2010
# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1285521521 -7200
# Node ID 2ccf70f4009ba01b91427471ac4fe0278dacb2c9
# Parent 99493545697daa9b65471eeb9687159919b0858a
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 --git a/hgext/keyword.py b/hgext/keyword.py
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -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():
More information about the Mercurial-devel
mailing list