mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
watchman: optionally log watchman commands via ui.log
Summary: This helps debugging watchman related issues. In particular, the order of watchman state-enter/leave events and other events. Reviewed By: singhsrb Differential Revision: D7648928 fbshipit-source-id: 527a7bef9a07c2526bdd40ad802d5ba06bc27226
This commit is contained in:
parent
857e9aa714
commit
2f37dcb182
@ -82,13 +82,19 @@ class client(object):
|
||||
|
||||
def _command(self, *args):
|
||||
watchmanargs = (args[0], self._root) + args[1:]
|
||||
self._ui.log('watchman-command',
|
||||
'watchman command %r started with timeout = %s',
|
||||
watchmanargs, self._timeout)
|
||||
try:
|
||||
if self._watchmanclient is None:
|
||||
self._firsttime = False
|
||||
self._watchmanclient = pywatchman.client(
|
||||
timeout=self._timeout,
|
||||
useImmutableBser=True)
|
||||
return self._watchmanclient.query(*watchmanargs)
|
||||
result = self._watchmanclient.query(*watchmanargs)
|
||||
self._ui.log('watchman-command',
|
||||
'watchman command %r completed', watchmanargs)
|
||||
return result
|
||||
except pywatchman.CommandError as ex:
|
||||
if 'unable to resolve root' in ex.msg:
|
||||
raise WatchmanNoRoot(self._root, ex.msg)
|
||||
|
Loading…
Reference in New Issue
Block a user