patch: rename "header" variable into "hdr" in diff()
The "header" variable was hiding the eponymous class, hence preventing its
usage.
--- a/mercurial/patch.py Thu Oct 05 08:03:57 2017 -0700
+++ b/mercurial/patch.py Tue Sep 26 18:17:47 2017 +0200
@@ -2316,13 +2316,13 @@
copy, if not empty, should contain mappings {dst@y: src@x} of copy
information.'''
- for header, hunks in diffhunks(repo, node1=node1, node2=node2, match=match,
- changes=changes, opts=opts,
- losedatafn=losedatafn, prefix=prefix,
- relroot=relroot, copy=copy):
+ for hdr, hunks in diffhunks(repo, node1=node1, node2=node2, match=match,
+ changes=changes, opts=opts,
+ losedatafn=losedatafn, prefix=prefix,
+ relroot=relroot, copy=copy):
text = ''.join(sum((list(hlines) for hrange, hlines in hunks), []))
- if header and (text or len(header) > 1):
- yield '\n'.join(header) + '\n'
+ if hdr and (text or len(hdr) > 1):
+ yield '\n'.join(hdr) + '\n'
if text:
yield text