changeset 33694:93422d0068f8

status: avoid recursing into ignored directory with "--terse u" Let "isignoreddir" function first check that supplied directory is itself ignored before walking recursively into its content. Otherwise, the command is awfully slow when one has an ignored directory with a lot of content. Update and rephrase function docstring accordingly.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Mon, 24 Jul 2017 10:34:32 +0200
parents db3dc11356ed
children eeed23508383
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Mon Jul 31 09:59:42 2017 +0530
+++ b/mercurial/cmdutil.py	Mon Jul 24 10:34:32 2017 +0200
@@ -466,12 +466,12 @@
         return True
 
     def isignoreddir(localpath):
-        """
-        This function checks whether the directory contains only ignored files
-        and hence should the directory be considered ignored. Returns True, if
-        that should be ignored otherwise False.
+        """Return True if `localpath` directory is ignored or contains only
+        ignored files and should hence be considered ignored.
         """
         dirpath = os.path.join(root, localpath)
+        if ignorefn(dirpath):
+            return True
         for f in os.listdir(dirpath):
             filepath = os.path.join(dirpath, f)
             if os.path.isdir(filepath):