Mercurial > public > mercurial-scm > hg-stable
diff hgext/keyword.py @ 7308:b6f5490effbf
patch: turn patch.diff() into a generator
This should even be a little faster than passing in an fp argument.
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Mon, 03 Nov 2008 16:48:23 +0100 |
parents | 292fb2ad2846 |
children | 87158be081b8 |
line wrap: on
line diff
--- a/hgext/keyword.py Mon Nov 03 16:31:47 2008 +0100 +++ b/hgext/keyword.py Mon Nov 03 16:48:23 2008 +0100 @@ -501,15 +501,15 @@ # shrink keywords read from working dir self.lines = kwt.shrinklines(self.fname, self.lines) - def kw_diff(orig, repo, node1=None, node2=None, match=None, - fp=None, changes=None, opts=None): + def kw_diff(orig, repo, node1=None, node2=None, match=None, changes=None, + opts=None): '''Monkeypatch patch.diff to avoid expansion except when comparing against working dir.''' if node2 is not None: kwt.matcher = util.never elif node1 is not None and node1 != repo['.'].node(): kwt.restrict = True - orig(repo, node1, node2, match, fp, changes, opts) + return orig(repo, node1, node2, match, changes, opts) def kwweb_skip(orig, web, req, tmpl): '''Wraps webcommands.x turning off keyword expansion.'''