Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/webutil.py @ 38519:4455e5d4d59c
context: explicitly take diffopts in `context.diff` (API)
To provide a proper replacement for the `patch.diff(?)` function, the
`context.diff(?)` method needs to be able to take more parameters. To
distinguish the diff options from the new other arguments, we upgrade the diff
options to its own explicit argument.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 22 May 2018 15:02:52 +0200 |
parents | 67dc32d4e790 |
children | 1770416de208 |
comparison
equal
deleted
inserted
replaced
38518:cf24f678adda | 38519:4455e5d4d59c |
---|---|
656 | 656 |
657 def diffstatgen(ctx, basectx): | 657 def diffstatgen(ctx, basectx): |
658 '''Generator function that provides the diffstat data.''' | 658 '''Generator function that provides the diffstat data.''' |
659 | 659 |
660 stats = patch.diffstatdata( | 660 stats = patch.diffstatdata( |
661 util.iterlines(ctx.diff(basectx, noprefix=False))) | 661 util.iterlines(ctx.diff(basectx, opts={'noprefix': False}))) |
662 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats) | 662 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats) |
663 while True: | 663 while True: |
664 yield stats, maxname, maxtotal, addtotal, removetotal, binary | 664 yield stats, maxname, maxtotal, addtotal, removetotal, binary |
665 | 665 |
666 def diffsummary(statgen): | 666 def diffsummary(statgen): |