Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
7307:56380212d630 | 7308:b6f5490effbf |
---|---|
1008 format. Read the gitdiffs help topic for more information. | 1008 format. Read the gitdiffs help topic for more information. |
1009 """ | 1009 """ |
1010 node1, node2 = cmdutil.revpair(repo, opts.get('rev')) | 1010 node1, node2 = cmdutil.revpair(repo, opts.get('rev')) |
1011 | 1011 |
1012 m = cmdutil.match(repo, pats, opts) | 1012 m = cmdutil.match(repo, pats, opts) |
1013 patch.diff(repo, node1, node2, match=m, opts=patch.diffopts(ui, opts)) | 1013 it = patch.diff(repo, node1, node2, match=m, opts=patch.diffopts(ui, opts)) |
1014 for chunk in it: | |
1015 repo.ui.write(chunk) | |
1014 | 1016 |
1015 def export(ui, repo, *changesets, **opts): | 1017 def export(ui, repo, *changesets, **opts): |
1016 """dump the header and diffs for one or more changesets | 1018 """dump the header and diffs for one or more changesets |
1017 | 1019 |
1018 Print the changeset header and diffs for one or more revisions. | 1020 Print the changeset header and diffs for one or more revisions. |