diff mercurial/context.py @ 38523:4455e5d4d59c

context: explicitly take diffopts in `context.diff` (API) To provide a proper replacement for the `patch.diff(?)` function, the `context.diff(?)` method needs to be able to take more parameters. To distinguish the diff options from the new other arguments, we upgrade the diff options to its own explicit argument.
author Boris Feld <boris.feld@octobus.net>
date Tue, 22 May 2018 15:02:52 +0200
parents da2a7d8354b2
children 02633fe3883a
line wrap: on
line diff
--- a/mercurial/context.py	Sun Jul 01 01:00:39 2018 +0530
+++ b/mercurial/context.py	Tue May 22 15:02:52 2018 +0200
@@ -294,13 +294,13 @@
                               auditor=r.nofsauditor, ctx=self,
                               listsubrepos=listsubrepos, badfn=badfn)
 
-    def diff(self, ctx2=None, match=None, **opts):
+    def diff(self, ctx2=None, match=None, opts=None):
         """Returns a diff generator for the given contexts and matcher"""
         if ctx2 is None:
             ctx2 = self.p1()
         if ctx2 is not None:
             ctx2 = self._repo[ctx2]
-        diffopts = patch.diffopts(self._repo.ui, pycompat.byteskwargs(opts))
+        diffopts = patch.diffopts(self._repo.ui, opts)
         return patch.diff(self._repo, ctx2, self, match=match, opts=diffopts)
 
     def dirs(self):