merge: cache unknown dir checks (issue5716)

Authored by mbthomas.


merge: cache unknown dir checks (issue5716)

As mentioned in D1222, the recent pathconflicts change regresses update
performance in large repositories when many files are being updated.

To mitigate this, we introduce two caches of directories that have
already found to be either:

  • unknown directories, but which are not aliased by files and so don't need to be checked if they are files again; and
  • missing directores, which cannot cause path conflicts, and cannot contain a file that causes a path conflict.

When checking the paths of a file, testing against this caches means we can
skip tests that involve touching the filesystem.

Differential Revision: https://phab.mercurial-scm.org/D1224