changeset 19569:00140039bd8f

localrepo: 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:42 -0500
parents f58235d85d6b
children f69ebcb06ce2
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Aug 06 15:11:31 2013 -0500
+++ b/mercurial/localrepo.py	Tue Aug 06 15:11:42 2013 -0500
@@ -1457,14 +1457,8 @@
                     del mf[fn]
             return mf
 
-        if isinstance(node1, context.changectx):
-            ctx1 = node1
-        else:
-            ctx1 = self[node1]
-        if isinstance(node2, context.changectx):
-            ctx2 = node2
-        else:
-            ctx2 = self[node2]
+        ctx1 = self[node1]
+        ctx2 = self[node2]
 
         working = ctx2.rev() is None
         parentworking = working and ctx1 == self['.']