Mercurial > public > mercurial-scm > hg-stable
diff hgext/record.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 | 6651de7176a0 |
children | 6fa7b6fb90a9 |
line wrap: on
line diff
--- a/hgext/record.py Mon Nov 03 16:31:47 2008 +0100 +++ b/hgext/record.py Mon Nov 03 16:48:23 2008 +0100 @@ -413,9 +413,10 @@ modified, added, removed = changes match = cmdutil.matchfiles(repo, modified + added + removed) diffopts = mdiff.diffopts(git=True, nodates=True) + chunks = patch.diff(repo, repo.dirstate.parents()[0], match=match, + changes=changes, opts=diffopts) fp = cStringIO.StringIO() - patch.diff(repo, repo.dirstate.parents()[0], match=match, - changes=changes, opts=diffopts, fp=fp) + fp.write(''.join(chunks)) fp.seek(0) # 1. filter patch, so we have intending-to apply subset of it