Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 7615:ab39d1813e51
patch: export shouldn't close files received as a parameter
We rely on __del__ to close the fd instead. Patchbomb was relying
on this behaviour, fix it.
Thanks to Manuel Barkhau for reporting it.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Fri, 09 Jan 2009 01:36:35 +0100 |
parents | 4f58147ea829 |
children | 3cc74ee75b0d |
comparison
equal
deleted
inserted
replaced
7611:dafcc96c1285 | 7615:ab39d1813e51 |
---|---|
1336 fp.write(ctx.description().rstrip()) | 1336 fp.write(ctx.description().rstrip()) |
1337 fp.write("\n\n") | 1337 fp.write("\n\n") |
1338 | 1338 |
1339 for chunk in diff(repo, prev, node, opts=opts): | 1339 for chunk in diff(repo, prev, node, opts=opts): |
1340 fp.write(chunk) | 1340 fp.write(chunk) |
1341 if fp not in (sys.stdout, repo.ui): | |
1342 fp.close() | |
1343 | 1341 |
1344 for seqno, rev in enumerate(revs): | 1342 for seqno, rev in enumerate(revs): |
1345 single(rev, seqno+1, fp) | 1343 single(rev, seqno+1, fp) |
1346 | 1344 |
1347 def diffstatdata(lines): | 1345 def diffstatdata(lines): |