D4844: treemanifests: skip extraneous check for item before calling _loadlazy

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Tue Oct 2 22:46:26 UTC 2018


spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4844

AFFECTED FILES
  mercurial/manifest.py

CHANGE DETAILS

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -817,8 +817,7 @@
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
-            if dir in self._lazydirs:
-                self._loadlazy(dir)
+            self._loadlazy(dir)
 
             if dir not in self._dirs:
                 return False
@@ -831,8 +830,7 @@
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
-            if dir in self._lazydirs:
-                self._loadlazy(dir)
+            self._loadlazy(dir)
 
             if dir not in self._dirs:
                 return default
@@ -844,8 +842,7 @@
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
-            if dir in self._lazydirs:
-                self._loadlazy(dir)
+            self._loadlazy(dir)
 
             return self._dirs[dir].__getitem__(subpath)
         else:
@@ -855,8 +852,7 @@
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
-            if dir in self._lazydirs:
-                self._loadlazy(dir)
+            self._loadlazy(dir)
 
             if dir not in self._dirs:
                 return ''
@@ -870,8 +866,7 @@
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
-            if dir in self._lazydirs:
-                self._loadlazy(dir)
+            self._loadlazy(dir)
 
             return self._dirs[dir].find(subpath)
         else:
@@ -881,8 +876,7 @@
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
-            if dir in self._lazydirs:
-                self._loadlazy(dir)
+            self._loadlazy(dir)
 
             self._dirs[dir].__delitem__(subpath)
             # If the directory is now empty, remove it
@@ -899,8 +893,7 @@
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
-            if dir in self._lazydirs:
-                self._loadlazy(dir)
+            self._loadlazy(dir)
             if dir not in self._dirs:
                 self._dirs[dir] = treemanifest(self._subpath(dir))
             self._dirs[dir].__setitem__(subpath, n)
@@ -921,8 +914,7 @@
         self._load()
         dir, subpath = _splittopdir(f)
         if dir:
-            if dir in self._lazydirs:
-                self._loadlazy(dir)
+            self._loadlazy(dir)
             if dir not in self._dirs:
                 self._dirs[dir] = treemanifest(self._subpath(dir))
             self._dirs[dir].setflag(subpath, flags)
@@ -993,8 +985,7 @@
         self._load()
         topdir, subdir = _splittopdir(dir)
         if topdir:
-            if topdir in self._lazydirs:
-                self._loadlazy(topdir)
+            self._loadlazy(topdir)
             if topdir in self._dirs:
                 return self._dirs[topdir].hasdir(subdir)
             return False



To: spectral, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list