--- a/mercurial/patch.py Fri Mar 03 17:46:28 2017 +0100
+++ b/mercurial/patch.py Fri Mar 03 17:46:40 2017 +0100
@@ -2549,10 +2549,11 @@
gitindex(content2)[0:opts.index],
gitmode[flag]))
- uheaders, text = mdiff.unidiff(content1, date1,
- content2, date2,
- path1, path2, opts=opts)
+ uheaders, hunks = mdiff.unidiff(content1, date1,
+ content2, date2,
+ path1, path2, opts=opts)
header.extend(uheaders)
+ text = ''.join(sum((list(hlines) for hrange, hlines in hunks), []))
if header and (text or len(header) > 1):
yield '\n'.join(header) + '\n'
if text: