Patchwork D8002: pathutil: mark parent directories as audited as we go

login
register
mail settings
Submitter phabricator
Date Jan. 29, 2020, 11:18 p.m.
Message ID <fb64edfa56065c1f85a0b4d6cd032239@localhost.localdomain>
Download mbox | patch
Permalink /patch/44739/
State Not Applicable
Headers show

Comments

phabricator - Jan. 29, 2020, 11:18 p.m.
Closed by commit rHG51c86c6167c1: pathutil: mark parent directories as audited as we go (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8002?vs=19593&id=19681

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8002/new/

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

AFFECTED FILES
  mercurial/pathutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/pathutil.py b/mercurial/pathutil.py
--- a/mercurial/pathutil.py
+++ b/mercurial/pathutil.py
@@ -99,7 +99,6 @@ 
 
         parts.pop()
         normparts.pop()
-        prefixes = []
         # It's important that we check the path parts starting from the root.
         # This means we won't accidentally traverse a symlink into some other
         # filesystem (which is potentially expensive to access).
@@ -110,13 +109,11 @@ 
                 continue
             if self._realfs:
                 self._checkfs(prefix, path)
-            prefixes.append(normprefix)
+            if self._cached:
+                self.auditeddir.add(normprefix)
 
         if self._cached:
             self.audited.add(normpath)
-            # only add prefixes to the cache after checking everything: we don't
-            # want to add "foo/bar/baz" before checking if there's a "foo/.hg"
-            self.auditeddir.update(prefixes)
 
     def _checkfs(self, prefix, path):
         """raise exception if a file system backed check fails"""