changeset 38567:97469c5430cd

synthrepo: pass a diffopts object to context.diff
author Boris Feld <boris.feld@octobus.net>
date Sat, 23 Jun 2018 14:46:28 +0200
parents 1770416de208
children f65e6095c5ac
files contrib/synthrepo.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/synthrepo.py	Sat Jun 23 14:42:58 2018 +0200
+++ b/contrib/synthrepo.py	Sat Jun 23 14:46:28 2018 +0200
@@ -60,7 +60,10 @@
     registrar,
     scmutil,
 )
-from mercurial.utils import dateutil
+from mercurial.utils import (
+    dateutil,
+    diffutil,
+)
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
@@ -193,8 +196,9 @@
             if lastctx.rev() != nullrev:
                 timedelta = ctx.date()[0] - lastctx.date()[0]
                 interarrival[roundto(timedelta, 300)] += 1
+            diffopts = diffutil.diffopts(ctx._repo.ui, {'git': True})
             diff = sum((d.splitlines()
-                       for d in ctx.diff(pctx, opts={'git': True})), [])
+                       for d in ctx.diff(pctx, opts=diffopts)), [])
             fileadds, diradds, fileremoves, filechanges = 0, 0, 0, 0
             for filename, mar, lineadd, lineremove, isbin in parsegitdiff(diff):
                 if isbin: