changeset 11105:6f4543842795

changectx: use repo.ui diffopts, allow argument override
author Steve Borho <steve@borho.org>
date Fri, 07 May 2010 10:59:11 -0500
parents 9fa028431957
children 213ca9ffcddb
files mercurial/context.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Fri May 07 17:03:48 2010 +0200
+++ b/mercurial/context.py	Fri May 07 10:59:11 2010 -0500
@@ -204,13 +204,15 @@
     def sub(self, path):
         return subrepo.subrepo(self, path)
 
-    def diff(self, ctx2=None, match=None):
+    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 and not isinstance(ctx2, changectx):
             ctx2 = self._repo[ctx2]
-        return patch.diff(self._repo, ctx2.node(), self.node(), match=match)
+        diffopts = patch.diffopts(self._repo.ui, opts)
+        return patch.diff(self._repo, ctx2.node(), self.node(),
+                          match=match, opts=diffopts)
 
 class filectx(object):
     """A filecontext object makes access to data related to a particular