patch: turn patch.diff() into a generator stable
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Mon, 03 Nov 2008 16:48:23 +0100
branchstable
changeset 502 6fccffd4059a
parent 500 bc63f54d577a
child 503 5cf987b0f3a1
child 504 2e610bc63d9e
patch: turn patch.diff() into a generator This should even be a little faster than passing in an fp argument. [ original upstream description ]
hgkw/keyword.py
--- a/hgkw/keyword.py	Wed Oct 22 17:34:52 2008 -0500
+++ b/hgkw/keyword.py	Mon Nov 03 16:48:23 2008 +0100
@@ -503,15 +503,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.'''