Patchwork [05,of,12,V2] tests: update test-context.py to use diffopts as diff argument

login
register
mail settings
Submitter Boris Feld
Date July 3, 2018, 10:32 a.m.
Message ID <0d2b1cf8cd7ecf819842.1530613944@FB-lair>
Download mbox | patch
Permalink /patch/32579/
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 1529756783 -3600
#      Sat Jun 23 13:26:23 2018 +0100
# Node ID 0d2b1cf8cd7ecf81984253ac1e5142f35a53eaa6
# Parent  2885f27ab442bf42ad8c21c47f4304132a62f59a
# EXP-Topic diff-cleanup
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0d2b1cf8cd7e
tests: update test-context.py to use diffopts as diff argument

Patch

diff --git a/tests/test-context.py b/tests/test-context.py
--- a/tests/test-context.py
+++ b/tests/test-context.py
@@ -10,6 +10,7 @@  from mercurial import (
     scmutil,
     ui as uimod,
 )
+from mercurial.utils import diffutil
 
 print_ = print
 def print(*args, **kwargs):
@@ -76,8 +77,8 @@  ctxb = context.memctx(repo, [ctxa.node()
 print(ctxb.status(ctxa))
 
 # test performing a diff on a memctx
-
-for d in ctxb.diff(ctxa, opts={'git': True}):
+diffopts = diffutil.diffopts(repo.ui, {'git': True})
+for d in ctxb.diff(ctxa, opts=diffopts):
     printb(d, end=b'')
 
 # test safeness and correctness of "ctx.status()"