changeset 33372:4481f1fd27b1

sparse: use self instead of repo.dirstate "self" here is the dirstate instance. I'm pretty confident that self and repo.dirstate will be the exact same object. So remove a dependency on repo by just looking at self.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 08 Jul 2017 15:42:11 -0700
parents c6415195fa78
children fb320398a21c
files hgext/sparse.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/sparse.py	Sat Jul 08 14:15:07 2017 -0700
+++ b/hgext/sparse.py	Sat Jul 08 15:42:11 2017 -0700
@@ -265,10 +265,9 @@
             repo = self.repo
             sparsematch = sparse.matcher(repo)
             if not sparsematch.always():
-                dirstate = repo.dirstate
                 for f in args:
                     if (f is not None and not sparsematch(f) and
-                        f not in dirstate):
+                        f not in self):
                         raise error.Abort(_("cannot add '%s' - it is outside "
                                             "the sparse checkout") % f,
                                           hint=hint)