# HG changeset patch # User Boris Feld # Date 1529756343 -3600 # Node ID c1a7bbf9984d2614bfac478d42c86377a84641ba # Parent 02633fe3883a597ef8f51ae91cf7b8cc1b1c5a55 context: also accept diff option directly For now we accept both diff option and dictionary. This will let us upgrade internal users gradually before we drop the old API at the end of this series. diff -r 02633fe3883a -r c1a7bbf9984d mercurial/context.py --- a/mercurial/context.py Wed May 23 15:31:40 2018 +0200 +++ b/mercurial/context.py Sat Jun 23 13:19:03 2018 +0100 @@ -30,6 +30,7 @@ error, fileset, match as matchmod, + mdiff, obsolete as obsmod, patch, pathutil, @@ -302,7 +303,11 @@ ctx2 = self.p1() if ctx2 is not None: ctx2 = self._repo[ctx2] - diffopts = patch.diffopts(self._repo.ui, opts) + + if isinstance(opts, mdiff.diffopts): + diffopts = opts + else: + diffopts = patch.diffopts(self._repo.ui, opts) return patch.diff(self._repo, ctx2, self, match=match, changes=changes, opts=diffopts, losedatafn=losedatafn, prefix=prefix, relroot=relroot, copy=copy,