mercurial/context.py
changeset 38521 c1a7bbf9984d
parent 38520 02633fe3883a
child 38569 62249cfe02d2
equal deleted inserted replaced
38520:02633fe3883a 38521:c1a7bbf9984d
    28     dagop,
    28     dagop,
    29     encoding,
    29     encoding,
    30     error,
    30     error,
    31     fileset,
    31     fileset,
    32     match as matchmod,
    32     match as matchmod,
       
    33     mdiff,
    33     obsolete as obsmod,
    34     obsolete as obsmod,
    34     patch,
    35     patch,
    35     pathutil,
    36     pathutil,
    36     phases,
    37     phases,
    37     pycompat,
    38     pycompat,
   300         """Returns a diff generator for the given contexts and matcher"""
   301         """Returns a diff generator for the given contexts and matcher"""
   301         if ctx2 is None:
   302         if ctx2 is None:
   302             ctx2 = self.p1()
   303             ctx2 = self.p1()
   303         if ctx2 is not None:
   304         if ctx2 is not None:
   304             ctx2 = self._repo[ctx2]
   305             ctx2 = self._repo[ctx2]
   305         diffopts = patch.diffopts(self._repo.ui, opts)
   306 
       
   307         if isinstance(opts, mdiff.diffopts):
       
   308             diffopts = opts
       
   309         else:
       
   310             diffopts = patch.diffopts(self._repo.ui, opts)
   306         return patch.diff(self._repo, ctx2, self, match=match, changes=changes,
   311         return patch.diff(self._repo, ctx2, self, match=match, changes=changes,
   307                           opts=diffopts, losedatafn=losedatafn, prefix=prefix,
   312                           opts=diffopts, losedatafn=losedatafn, prefix=prefix,
   308                           relroot=relroot, copy=copy,
   313                           relroot=relroot, copy=copy,
   309                           hunksfilterfn=hunksfilterfn)
   314                           hunksfilterfn=hunksfilterfn)
   310 
   315