# HG changeset patch # User Denis Laxalde # Date 2017-09-26 16:17:47 # Node ID fe6125ebdf91f5e7a5d4a3e772700faeb4511051 # Parent 1248aa48cac98b201345c1fa43001802a06c7227 patch: rename "header" variable into "hdr" in diff() The "header" variable was hiding the eponymous class, hence preventing its usage. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2316,13 +2316,13 @@ def diff(repo, node1=None, node2=None, m 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