Patchwork D4161: dirstate: add a comment on why we don't need to check if something is a dir/file

login
register
mail settings
Submitter phabricator
Date Aug. 9, 2018, 12:22 a.m.
Message ID <7740bfc019ecb2b4f4f3b27bc9be2970@localhost.localdomain>
Download mbox | patch
Permalink /patch/33434/
State Not Applicable
Headers show

Comments

phabricator - Aug. 9, 2018, 12:22 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG058497a2cc36: dirstate: add a comment on why we don&#039;t need to check if something is a dir/file (authored by spectral, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4161?vs=10081&id=10087

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -912,6 +912,11 @@ 
                         continue
                     raise
                 for f, kind, st in entries:
+                    # If we needed to inspect any files, visitentries would have
+                    # been 'this' or 'all', and we would have set it to None
+                    # above. If we have visitentries populated here, we don't
+                    # care about any files in this directory, so no need to
+                    # check the type of `f`.
                     if visitentries and f not in visitentries:
                         continue
                     if normalizefile: