##// END OF EJS Templates
basectx: move diff from changectx
Sean Farley -
r19564:f0ed47b7 default
parent child Browse files
Show More
@@ -128,6 +128,16 b' class basectx(object):'
128 include, exclude, default,
128 include, exclude, default,
129 auditor=r.auditor, ctx=self)
129 auditor=r.auditor, ctx=self)
130
130
131 def diff(self, ctx2=None, match=None, **opts):
132 """Returns a diff generator for the given contexts and matcher"""
133 if ctx2 is None:
134 ctx2 = self.p1()
135 if ctx2 is not None and not isinstance(ctx2, changectx):
136 ctx2 = self._repo[ctx2]
137 diffopts = patch.diffopts(self._repo.ui, opts)
138 return patch.diff(self._repo, ctx2.node(), self.node(),
139 match=match, opts=diffopts)
140
131 class changectx(basectx):
141 class changectx(basectx):
132 """A changecontext object makes access to data related to a particular
142 """A changecontext object makes access to data related to a particular
133 changeset convenient. It represents a read-only context already presnt in
143 changeset convenient. It represents a read-only context already presnt in
@@ -389,16 +399,6 b' class changectx(basectx):'
389 if match.bad(fn, _('no such file in rev %s') % self) and match(fn):
399 if match.bad(fn, _('no such file in rev %s') % self) and match(fn):
390 yield fn
400 yield fn
391
401
392 def diff(self, ctx2=None, match=None, **opts):
393 """Returns a diff generator for the given contexts and matcher"""
394 if ctx2 is None:
395 ctx2 = self.p1()
396 if ctx2 is not None and not isinstance(ctx2, changectx):
397 ctx2 = self._repo[ctx2]
398 diffopts = patch.diffopts(self._repo.ui, opts)
399 return patch.diff(self._repo, ctx2.node(), self.node(),
400 match=match, opts=diffopts)
401
402 @propertycache
402 @propertycache
403 def _dirs(self):
403 def _dirs(self):
404 return scmutil.dirs(self._manifest)
404 return scmutil.dirs(self._manifest)
General Comments 0
You need to be logged in to leave comments. Login now