diff hgext/largefiles/reposetup.py @ 35084:61888bd0b300

dirstate: add explicit methods for querying directories (API) The set-like object returned by dirstate.dirs may be difficult for other implementations of the dirstate to provide, and is unnecessary as it is only ever used for __contains__. Instead, provide an explicit method for testing for a directory. .. api:: dirstate no longer provides a `dirs()` method. To test for the existence of a directory in the dirstate, use `dirstate.hasdir(dirname)`. Differential Revision: https://phab.mercurial-scm.org/D1345
author Mark Thomas <mbthomas@fb.com>
date Wed, 15 Nov 2017 01:07:42 -0800
parents ac0cd81e2f83
children 0531dff73d0b
line wrap: on
line diff
--- a/hgext/largefiles/reposetup.py	Wed Nov 15 01:07:42 2017 -0800
+++ b/hgext/largefiles/reposetup.py	Wed Nov 15 01:07:42 2017 -0800
@@ -138,7 +138,7 @@
                         sf = lfutil.standin(f)
                         if sf in dirstate:
                             newfiles.append(sf)
-                        elif sf in dirstate.dirs():
+                        elif dirstate.hasdir(sf):
                             # Directory entries could be regular or
                             # standin, check both
                             newfiles.extend((f, sf))
@@ -156,7 +156,7 @@
                     def sfindirstate(f):
                         sf = lfutil.standin(f)
                         dirstate = self.dirstate
-                        return sf in dirstate or sf in dirstate.dirs()
+                        return sf in dirstate or dirstate.hasdir(sf)
 
                     match._files = [f for f in match._files
                                     if sfindirstate(f)]