Mercurial > public > mercurial-scm > hg
diff mercurial/commands.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 | 56380212d630 |
children | 9fe97eea5510 |
line wrap: on
line diff
--- a/mercurial/commands.py Mon Nov 03 16:31:47 2008 +0100 +++ b/mercurial/commands.py Mon Nov 03 16:48:23 2008 +0100 @@ -1010,7 +1010,9 @@ node1, node2 = cmdutil.revpair(repo, opts.get('rev')) m = cmdutil.match(repo, pats, opts) - patch.diff(repo, node1, node2, match=m, opts=patch.diffopts(ui, opts)) + it = patch.diff(repo, node1, node2, match=m, opts=patch.diffopts(ui, opts)) + for chunk in it: + repo.ui.write(chunk) def export(ui, repo, *changesets, **opts): """dump the header and diffs for one or more changesets