hgext/keyword.py
changeset 33063 7f569ce30216
parent 32935 69d1c3ea0d6f
child 33064 9062458febca
--- a/hgext/keyword.py	Mon Jun 26 22:27:34 2017 +0900
+++ b/hgext/keyword.py	Mon Jun 26 03:38:12 2017 +0900
@@ -665,8 +665,13 @@
 
     def kwdiff(orig, *args, **kwargs):
         '''Monkeypatch patch.diff to avoid expansion.'''
+        restrict = kwt.restrict
         kwt.restrict = True
-        return orig(*args, **kwargs)
+        try:
+            for chunk in orig(*args, **kwargs):
+                yield chunk
+        finally:
+            kwt.restrict = restrict
 
     def kwweb_skip(orig, web, req, tmpl):
         '''Wraps webcommands.x turning off keyword expansion.'''