treemanifest: make hasdir() faster
Same rationale as the previous change.
--- a/mercurial/manifest.py Tue Mar 03 13:50:06 2015 -0800
+++ b/mercurial/manifest.py Mon Mar 16 16:01:16 2015 -0700
@@ -506,7 +506,12 @@
return self._alldirs
def hasdir(self, dir):
- return dir in self._alldirs
+ topdir, subdir = _splittopdir(dir)
+ if topdir:
+ if topdir in self._dirs:
+ return self._dirs[topdir].hasdir(subdir)
+ return False
+ return (dir + '/') in self._dirs
def matches(self, match):
'''generate a new manifest filtered by the match argument'''