##// END OF EJS Templates
match: document that visitchildrenset might return files...
Kyle Lippincott -
r39296:27946fca default
parent child Browse files
Show More
@@ -912,11 +912,14 b' class dirstate(object):'
912 912 continue
913 913 raise
914 914 for f, kind, st in entries:
915 # If we needed to inspect any files, visitentries would have
916 # been 'this' or 'all', and we would have set it to None
917 # above. If we have visitentries populated here, we don't
918 # care about any files in this directory, so no need to
919 # check the type of `f`.
915 # Some matchers may return files in the visitentries set,
916 # instead of 'this', if the matcher explicitly mentions them
917 # and is not an exactmatcher. This is acceptable; we do not
918 # make any hard assumptions about file-or-directory below
919 # based on the presence of `f` in visitentries. If
920 # visitchildrenset returned a set, we can always skip the
921 # entries *not* in the set it provided regardless of whether
922 # they're actually a file or a directory.
920 923 if visitentries and f not in visitentries:
921 924 continue
922 925 if normalizefile:
@@ -346,7 +346,7 b' class basematcher(object):'
346 346 ----------+-------------------
347 347 False | set()
348 348 'all' | 'all'
349 True | 'this' OR non-empty set of subdirs to visit
349 True | 'this' OR non-empty set of subdirs -or files- to visit
350 350
351 351 Example:
352 352 Assume matchers ['path:foo/bar', 'rootfilesin:qux'], we would return
@@ -357,10 +357,21 b' class basematcher(object):'
357 357 'baz' -> set()
358 358 'foo' -> {'bar'}
359 359 # Ideally this would be 'all', but since the prefix nature of matchers
360 # is applied to the entire matcher, we have to downgrade to this
361 # 'this' due to the non-prefix 'rootfilesin'-kind matcher.
360 # is applied to the entire matcher, we have to downgrade this to
361 # 'this' due to the non-prefix 'rootfilesin'-kind matcher being mixed
362 # in.
362 363 'foo/bar' -> 'this'
363 364 'qux' -> 'this'
365
366 Important:
367 Most matchers do not know if they're representing files or
368 directories. They see ['path:dir/f'] and don't know whether 'f' is a
369 file or a directory, so visitchildrenset('dir') for most matchers will
370 return {'f'}, but if the matcher knows it's a file (like exactmatcher
371 does), it may return 'this'. Do not rely on the return being a set
372 indicating that there are no files in this dir to investigate (or
373 equivalently that if there are files to investigate in 'dir' that it
374 will always return 'this').
364 375 '''
365 376 return 'this'
366 377
General Comments 0
You need to be logged in to leave comments. Login now