Patchwork [10,of,12,V2] obsutil: pass a diffopts object to context.diff

login
register
mail settings
Submitter Boris Feld
Date July 3, 2018, 10:32 a.m.
Message ID <8c1405ef2dd9a1bf82dc.1530613949@FB-lair>
Download mbox | patch
Permalink /patch/32576/
State Accepted
Headers show

Comments

Boris Feld - July 3, 2018, 10:32 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1529758816 -7200
#      Sat Jun 23 15:00:16 2018 +0200
# Node ID 8c1405ef2dd9a1bf82dc320b39ee6a359240a088
# Parent  d05882e5af1a7d482eedea7aebc7eb1cba000643
# EXP-Topic diff-cleanup
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 8c1405ef2dd9
obsutil: pass a diffopts object to context.diff

Patch

diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -15,7 +15,10 @@  from . import (
     phases,
     util,
 )
-from .utils import dateutil
+from .utils import (
+    dateutil,
+    diffutil,
+)
 
 ### obsolescence marker flag
 
@@ -392,13 +395,13 @@  def _cmpdiff(leftctx, rightctx):
 
     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):