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.
--- 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):