comparison mercurial/hgweb/webutil.py @ 41618:e834f6f6f221

patch: pass in context objects into diffhunks() (API) It's a pretty low-level function and having the contexts in patch.diff() makes future patches easier. Differential Revision: https://phab.mercurial-scm.org/D5891
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 06 Feb 2019 17:27:43 -0800
parents eff0a7d3229c
children 0531dff73d0b
comparison
equal deleted inserted replaced
41617:36ee0d6d64c5 41618:e834f6f6f221
568 m = match.exact(repo.root, repo.getcwd(), files) 568 m = match.exact(repo.root, repo.getcwd(), files)
569 else: 569 else:
570 m = match.always(repo.root, repo.getcwd()) 570 m = match.always(repo.root, repo.getcwd())
571 571
572 diffopts = patch.diffopts(repo.ui, untrusted=True) 572 diffopts = patch.diffopts(repo.ui, untrusted=True)
573 node1 = basectx.node()
574 node2 = ctx.node()
575 parity = paritygen(stripecount) 573 parity = paritygen(stripecount)
576 574
577 diffhunks = patch.diffhunks(repo, node1, node2, m, opts=diffopts) 575 diffhunks = patch.diffhunks(repo, basectx, ctx, m, opts=diffopts)
578 for blockno, (fctx1, fctx2, header, hunks) in enumerate(diffhunks, 1): 576 for blockno, (fctx1, fctx2, header, hunks) in enumerate(diffhunks, 1):
579 if style != 'raw': 577 if style != 'raw':
580 header = header[1:] 578 header = header[1:]
581 lines = [h + '\n' for h in header] 579 lines = [h + '\n' for h in header]
582 for hunkrange, hunklines in hunks: 580 for hunkrange, hunklines in hunks: