changeset 19570:f69ebcb06ce2

largefiles: 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. This also removes the need to import the context module.
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 06 Aug 2013 15:10:09 -0500
parents 00140039bd8f
children 103edf3ed79e
files hgext/largefiles/reposetup.py
diffstat 1 files changed, 3 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/reposetup.py	Tue Aug 06 15:11:42 2013 -0500
+++ b/hgext/largefiles/reposetup.py	Tue Aug 06 15:10:09 2013 -0500
@@ -10,8 +10,7 @@
 import copy
 import os
 
-from mercurial import context, error, manifest, match as match_, util, \
-    discovery
+from mercurial import error, manifest, match as match_, util, discovery
 from mercurial import node as node_
 from mercurial.i18n import _
 from mercurial import localrepo
@@ -92,14 +91,8 @@
             else:
                 # some calls in this function rely on the old version of status
                 self.lfstatus = False
-                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['.']