comparison mercurial/context.py @ 19568:f58235d85d6b

basectx: remove unnecessary check of instance The refactoring of all the context objects allows us to simply pass a basectx to the __new__ constructor and have it return the same object without allocating new memory.
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 06 Aug 2013 15:11:31 -0500
parents 49b128e50e84
children 103edf3ed79e
comparison
equal deleted inserted replaced
19567:49b128e50e84 19568:f58235d85d6b
130 130
131 def diff(self, ctx2=None, match=None, **opts): 131 def diff(self, ctx2=None, match=None, **opts):
132 """Returns a diff generator for the given contexts and matcher""" 132 """Returns a diff generator for the given contexts and matcher"""
133 if ctx2 is None: 133 if ctx2 is None:
134 ctx2 = self.p1() 134 ctx2 = self.p1()
135 if ctx2 is not None and not isinstance(ctx2, changectx): 135 if ctx2 is not None:
136 ctx2 = self._repo[ctx2] 136 ctx2 = self._repo[ctx2]
137 diffopts = patch.diffopts(self._repo.ui, opts) 137 diffopts = patch.diffopts(self._repo.ui, opts)
138 return patch.diff(self._repo, ctx2.node(), self.node(), 138 return patch.diff(self._repo, ctx2.node(), self.node(),
139 match=match, opts=diffopts) 139 match=match, opts=diffopts)
140 140