match: skip walking up the directory hierarchy if the number of pats are small
Previously, we would receive a path like abc/def/ghi and "walk up" the directory
hierarchy, checking abc/def, abc, and `b''` to see if they were in the set of
prefixes that this matcher covered. We did this indiscriminately - we generated
all of these paths even if the set of prefixes the matcher covered was
completely empty, which is the case for a lot of repos at my company (the narrow
matcher we use is usually non-recursive).
This brings the time for a rebase in one of my repos from 12.20s to 10.87s. In
this particular repo, this is entirely due to the `len(prefix_set) == 0` check,
as I do not have any recursive patterns in the narrowspec.
Differential Revision: https://phab.mercurial-scm.org/D9488
Mercurial
=========
Mercurial is a fast, easy to use, distributed revision control tool
for software developers.
Basic install::
$ make # see install targets
$ make install # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg # see help
Running without installing::
$ make local # build for inplace usage
$ ./hg --version # should show the latest version
See https://mercurial-scm.org/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.