comparison contrib/synthrepo.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 ce65c25dc161
children 97469c5430cd
comparison
equal deleted inserted replaced
38518:cf24f678adda 38519:4455e5d4d59c
191 else: 191 else:
192 lastctx = repo[rev - 1] 192 lastctx = repo[rev - 1]
193 if lastctx.rev() != nullrev: 193 if lastctx.rev() != nullrev:
194 timedelta = ctx.date()[0] - lastctx.date()[0] 194 timedelta = ctx.date()[0] - lastctx.date()[0]
195 interarrival[roundto(timedelta, 300)] += 1 195 interarrival[roundto(timedelta, 300)] += 1
196 diff = sum((d.splitlines() for d in ctx.diff(pctx, git=True)), []) 196 diff = sum((d.splitlines()
197 for d in ctx.diff(pctx, opts={'git': True})), [])
197 fileadds, diradds, fileremoves, filechanges = 0, 0, 0, 0 198 fileadds, diradds, fileremoves, filechanges = 0, 0, 0, 0
198 for filename, mar, lineadd, lineremove, isbin in parsegitdiff(diff): 199 for filename, mar, lineadd, lineremove, isbin in parsegitdiff(diff):
199 if isbin: 200 if isbin:
200 continue 201 continue
201 added = sum(lineadd.itervalues(), 0) 202 added = sum(lineadd.itervalues(), 0)