[PATCH 32 of 35 V2] context: remove unnecessary check of instance
Sean Farley
sean.michael.farley at gmail.com
Wed Aug 7 18:51:46 CDT 2013
# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1375819891 18000
# Tue Aug 06 15:11:31 2013 -0500
# Node ID 2b9d9c462478e5d903c8e9392e914ebde96d3189
# Parent 3a28dc78de7f225d29db6427c035e1f962414b59
context: remove unnecessary check of instance
The refactoring of all the context objects allows us to simply pass a context
to the __new__ constructor and have it return the same object without
allocating new memory.
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -130,11 +130,11 @@
def diff(self, ctx2=None, match=None, **opts):
"""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):
+ if ctx2 is not None:
ctx2 = self._repo[ctx2]
diffopts = patch.diffopts(self._repo.ui, opts)
return patch.diff(self._repo, ctx2.node(), self.node(),
match=match, opts=diffopts)
More information about the Mercurial-devel
mailing list