Mercurial > public > mercurial-scm > hg-stable
diff contrib/synthrepo.py @ 38523: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 | ce65c25dc161 |
children | 97469c5430cd |
line wrap: on
line diff
--- a/contrib/synthrepo.py Sun Jul 01 01:00:39 2018 +0530 +++ b/contrib/synthrepo.py Tue May 22 15:02:52 2018 +0200 @@ -193,7 +193,8 @@ if lastctx.rev() != nullrev: timedelta = ctx.date()[0] - lastctx.date()[0] interarrival[roundto(timedelta, 300)] += 1 - diff = sum((d.splitlines() for d in ctx.diff(pctx, git=True)), []) + diff = sum((d.splitlines() + for d in ctx.diff(pctx, opts={'git': True})), []) fileadds, diradds, fileremoves, filechanges = 0, 0, 0, 0 for filename, mar, lineadd, lineremove, isbin in parsegitdiff(diff): if isbin: