armuk/watchman — pull request #1 by armuk (2013-11-22 14:45:53+00:00)
Title: [watchman] use fsevents on osx

Summary:
fseventsd uses some low level OS magic to subscribe to filesystem
changes without needing to hold an open descriptor for everything.

This diff makes us use it on OS/X. For the most part, this diff
is pretty clear. There are two things that are worth calling out:

* Discovered that we should have put the root number into the cookie filename
to avoid the potential for cookie filename collisions when we recrawl and rewind
the tick counter

* We run fsevents in a thread of its own so that we can filter out ignored items and
test to see if events are available (there is no native "poll" functionality that I can
find). This is begging to be refactored and we'll take care of that in a later diff.

Test Plan: `make integration` passes

Reviewers: sid0, fugalh

Reviewed By: fugalh

CC: royw

Differential Revision: https://phabricator.fb.com/D1031495