Watchman.get_mergebase
commit9359852ee762d46de15dbf0761b7c609911a7b5c
authorGabe Levi <gabe@fb.com>
Thu, 22 Nov 2018 01:16:45 +0000 (21 17:16 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 22 Nov 2018 01:19:23 +0000 (21 17:19 -0800)
treead9ea7659841559a013256951c3a27269e3c3e75
parent1ac57226fdc64d654566b80c229dbbb8d2db8d8a
Watchman.get_mergebase

Summary:
This adds an API to `Watchman` and `Watchman_lwt` which uses a one-off scm-aware watchman query to figure out the mergebase.

I am adding this because I want to know when the mergebase changes. Unfortunately, I can't use an scm-aware subscription, because it would filter out files which change during a rebase. So instead, I plan to call `Watchman_lwt.get_mergebase` whenever an `hg.update` finishes, to detect when the mergebase changes.

It's important to note, this will NOT use the existing connection for this one-off query. The existing connection might be used for a subscription, which means watchman might push a message to us and we may mis-interpret that message as a response.

Reviewed By: jbrown215

Differential Revision: D13060161

fbshipit-source-id: db179da6dd49d38da02fc6b66c9d632a27acb445
hphp/hack/src/watchman/watchman.ml
hphp/hack/src/watchman/watchman_sig.ml