changeset 38568:f65e6095c5ac

obsutil: pass a diffopts object to context.diff
author Boris Feld <boris.feld@octobus.net>
date Sat, 23 Jun 2018 15:00:16 +0200
parents 97469c5430cd
children 62249cfe02d2
files mercurial/obsutil.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/obsutil.py	Sat Jun 23 14:46:28 2018 +0200
+++ b/mercurial/obsutil.py	Sat Jun 23 15:00:16 2018 +0200
@@ -15,7 +15,10 @@
     phases,
     util,
 )
-from .utils import dateutil
+from .utils import (
+    dateutil,
+    diffutil,
+)
 
 ### obsolescence marker flag
 
@@ -392,13 +395,13 @@
 
     This is a first and basic implementation, with many shortcoming.
     """
-
+    diffopts = diffutil.diffopts(leftctx._repo.ui, {'git': True})
     # Leftctx or right ctx might be filtered, so we need to use the contexts
     # with an unfiltered repository to safely compute the diff
     leftunfi = leftctx._repo.unfiltered()[leftctx.rev()]
-    leftdiff = leftunfi.diff(opts={'git': True})
+    leftdiff = leftunfi.diff(opts=diffopts)
     rightunfi = rightctx._repo.unfiltered()[rightctx.rev()]
-    rightdiff = rightunfi.diff(opts={'git': True})
+    rightdiff = rightunfi.diff(opts=diffopts)
 
     left, right = (0, 0)
     while None not in (left, right):