match: handle large regexes
Some Python versions don't handle large regexes, so when we hit an
overflow, split our regex in two.
path_auditor: cache names of audited directories
We use a separate cache to avoid problems with
audit = path_auditor(repo.root)
audit("subrepo")
audit("subrepo/file")
whitelisting "subrepo" (which is fine) and then using the same whitelist
with "subrepo/file" (which is not fine).
Since we create a separate path_auditor for every path on the command line,
a "hg add dir/a dir/b dir/c" will still lstat dir 3 times just to audit
the paths.
Quote ^ and ~ chars in test-parentrevspec.
At least ^ causes problems on some sh implementations.
Enable demandimport only in scripts, not in importable modules (
issue605)
This way other applications can choose if and when they want this feature,
because it might be problematic if those applications rely on ImportError.