fsmonitor

This extension is currently being distributed along with Mercurial.

Author: Facebook, Inc.

This extension was previously known as hgwatchman before being merged into Mercurial.

1. Overview

Integrates the file-monitoring 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.

2. Configuration

First, you'll need to install Watchman from https://facebook.github.io/watchman/ and make sure it is in your PATH.

Configure your .hgrc to enable the extension by adding following lines:

[extensions]
fsmonitor =

fsmonitor requires no configuration -- it will tell Watchman about your repository as necessary

The following configuration options exist:

[fsmonitor]
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.

[fsmonitor]
timeout = (float)

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

[fsmonitor]
blacklistusers = (list of userids)

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

[fsmonitor]
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.

3. Platforms Supported

4. Known Issues

The issues related to nested repos and subrepos are probably not fundamental ones. Patches to fix them are welcome.


CategoryExtensionsByOthers

FsMonitorExtension (last edited 2017-01-26 21:01:58 by NathanGoldbaum)