##// END OF EJS Templates
diff: also yield file context objects in patch.trydiff() (API)...
Denis Laxalde -
r34856:35c6a54e default
parent child Browse files
Show More
@@ -479,7 +479,7 b' def diffs(web, tmpl, ctx, basectx, files'
479 parity = paritygen(web.stripecount)
479 parity = paritygen(web.stripecount)
480
480
481 diffhunks = patch.diffhunks(repo, node1, node2, m, opts=diffopts)
481 diffhunks = patch.diffhunks(repo, node1, node2, m, opts=diffopts)
482 for blockno, (header, hunks) in enumerate(diffhunks, 1):
482 for blockno, (fctx1, fctx2, header, hunks) in enumerate(diffhunks, 1):
483 if style != 'raw':
483 if style != 'raw':
484 header = header[1:]
484 header = header[1:]
485 lines = [h + '\n' for h in header]
485 lines = [h + '\n' for h in header]
@@ -2319,10 +2319,11 b' def diff(repo, node1=None, node2=None, m'
2319
2319
2320 copy, if not empty, should contain mappings {dst@y: src@x} of copy
2320 copy, if not empty, should contain mappings {dst@y: src@x} of copy
2321 information.'''
2321 information.'''
2322 for hdr, hunks in diffhunks(repo, node1=node1, node2=node2, match=match,
2322 for fctx1, fctx2, hdr, hunks in diffhunks(
2323 changes=changes, opts=opts,
2323 repo, node1=node1, node2=node2,
2324 losedatafn=losedatafn, prefix=prefix,
2324 match=match, changes=changes, opts=opts,
2325 relroot=relroot, copy=copy):
2325 losedatafn=losedatafn, prefix=prefix, relroot=relroot, copy=copy,
2326 ):
2326 text = ''.join(sum((list(hlines) for hrange, hlines in hunks), []))
2327 text = ''.join(sum((list(hlines) for hrange, hlines in hunks), []))
2327 if hdr and (text or len(hdr) > 1):
2328 if hdr and (text or len(hdr) > 1):
2328 yield '\n'.join(hdr) + '\n'
2329 yield '\n'.join(hdr) + '\n'
@@ -2687,7 +2688,7 b' def trydiff(repo, revs, ctx1, ctx2, modi'
2687 content2, date2,
2688 content2, date2,
2688 path1, path2, opts=opts)
2689 path1, path2, opts=opts)
2689 header.extend(uheaders)
2690 header.extend(uheaders)
2690 yield header, hunks
2691 yield fctx1, fctx2, header, hunks
2691
2692
2692 def diffstatsum(stats):
2693 def diffstatsum(stats):
2693 maxfile, maxtotal, addtotal, removetotal, binary = 0, 0, 0, 0, False
2694 maxfile, maxtotal, addtotal, removetotal, binary = 0, 0, 0, 0, False
General Comments 0
You need to be logged in to leave comments. Login now