##// END OF EJS Templates
synthrepo: pass a diffopts object to context.diff
Boris Feld -
r38586:97469c54 default
parent child Browse files
Show More
@@ -60,7 +60,10 b' from mercurial import ('
60 registrar,
60 registrar,
61 scmutil,
61 scmutil,
62 )
62 )
63 from mercurial.utils import dateutil
63 from mercurial.utils import (
64 dateutil,
65 diffutil,
66 )
64
67
65 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
68 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
66 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
69 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -193,8 +196,9 b' def analyze(ui, repo, *revs, **opts):'
193 if lastctx.rev() != nullrev:
196 if lastctx.rev() != nullrev:
194 timedelta = ctx.date()[0] - lastctx.date()[0]
197 timedelta = ctx.date()[0] - lastctx.date()[0]
195 interarrival[roundto(timedelta, 300)] += 1
198 interarrival[roundto(timedelta, 300)] += 1
199 diffopts = diffutil.diffopts(ctx._repo.ui, {'git': True})
196 diff = sum((d.splitlines()
200 diff = sum((d.splitlines()
197 for d in ctx.diff(pctx, opts={'git': True})), [])
201 for d in ctx.diff(pctx, opts=diffopts)), [])
198 fileadds, diradds, fileremoves, filechanges = 0, 0, 0, 0
202 fileadds, diradds, fileremoves, filechanges = 0, 0, 0, 0
199 for filename, mar, lineadd, lineremove, isbin in parsegitdiff(diff):
203 for filename, mar, lineadd, lineremove, isbin in parsegitdiff(diff):
200 if isbin:
204 if isbin:
General Comments 0
You need to be logged in to leave comments. Login now