Integrates the file-watching program Watchman with Mercurial to produce faster status results.

On a particular Linux system, for a real-world repository with over 400,000 files hosted on ext4, vanilla hg status takes 1.3 seconds. On the same system, with fsmonitor it takes about 0.3 seconds.

fsmonitor requires no configuration -- it will tell Watchman about your repository as necessary. You'll need to install Watchman from https://facebook.github.io/watchman/ and make sure it is in your PATH.

fsmonitor is incompatible with the largefiles and eol extensions, and will disable itself if any of those are active.

The following configuration options exist:

mode = {off, on, paranoid}

When mode = off, fsmonitor will disable itself (similar to not loading the extension at all). When mode = on, fsmonitor will be enabled (the default). When mode = paranoid, fsmonitor will query both Watchman and the filesystem, and ensure that the results are consistent.

timeout = (float)

A value, in seconds, that determines how long fsmonitor will wait for Watchman to return results. Defaults to 2.0.

blacklistusers = (list of userids)

A list of usernames for which fsmonitor will disable itself altogether.

walk_on_invalidate = (boolean)

Whether or not to walk the whole repo ourselves when our cached state has been invalidated, for example when Watchman has been restarted or .hgignore rules have been changed. Walking the repo in that case can result in competing for I/O with Watchman. For large repos it is recommended to set this value to false. You may wish to set this to true if you have a very fast filesystem that can outpace the IPC overhead of getting the result data for the full repo from Watchman. Defaults to false.

warn_when_unused = (boolean)

Whether to print a warning during certain operations when fsmonitor would be beneficial to performance but isn't enabled.

warn_update_file_count = (integer)

If warn_when_unused is set and fsmonitor isn't enabled, a warning will be printed during working directory updates if this many files will be created.