comparison mercurial/patch.py @ 34561:fe6125ebdf91

patch: rename "header" variable into "hdr" in diff() The "header" variable was hiding the eponymous class, hence preventing its usage.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Tue, 26 Sep 2017 18:17:47 +0200
parents aacb17cc0ee4
children 60213a2eca81
comparison
equal deleted inserted replaced
34560:1248aa48cac9 34561:fe6125ebdf91
2314 relroot, if not empty, must be normalized with a trailing /. Any match 2314 relroot, if not empty, must be normalized with a trailing /. Any match
2315 patterns that fall outside it will be ignored. 2315 patterns that fall outside it will be ignored.
2316 2316
2317 copy, if not empty, should contain mappings {dst@y: src@x} of copy 2317 copy, if not empty, should contain mappings {dst@y: src@x} of copy
2318 information.''' 2318 information.'''
2319 for header, hunks in diffhunks(repo, node1=node1, node2=node2, match=match, 2319 for hdr, hunks in diffhunks(repo, node1=node1, node2=node2, match=match,
2320 changes=changes, opts=opts, 2320 changes=changes, opts=opts,
2321 losedatafn=losedatafn, prefix=prefix, 2321 losedatafn=losedatafn, prefix=prefix,
2322 relroot=relroot, copy=copy): 2322 relroot=relroot, copy=copy):
2323 text = ''.join(sum((list(hlines) for hrange, hlines in hunks), [])) 2323 text = ''.join(sum((list(hlines) for hrange, hlines in hunks), []))
2324 if header and (text or len(header) > 1): 2324 if hdr and (text or len(hdr) > 1):
2325 yield '\n'.join(header) + '\n' 2325 yield '\n'.join(hdr) + '\n'
2326 if text: 2326 if text:
2327 yield text 2327 yield text
2328 2328
2329 def diffhunks(repo, node1=None, node2=None, match=None, changes=None, 2329 def diffhunks(repo, node1=None, node2=None, match=None, changes=None,
2330 opts=None, losedatafn=None, prefix='', relroot='', copy=None): 2330 opts=None, losedatafn=None, prefix='', relroot='', copy=None):