##// END OF EJS Templates
watchman: add the possibility to set the exact watchman binary location...
Boris Feld -
r42134:57264906 default
parent child Browse files
Show More
@@ -161,6 +161,9 b" configitem('fsmonitor', 'timeout',"
161 161 configitem('fsmonitor', 'blacklistusers',
162 162 default=list,
163 163 )
164 configitem('fsmonitor', 'watchman_exe',
165 default='watchman',
166 )
164 167 configitem('fsmonitor', 'verbose',
165 168 default=True,
166 169 )
@@ -317,7 +317,7 b' class UnixSocketTransport(Transport):'
317 317 """ local unix domain socket transport """
318 318 sock = None
319 319
320 def __init__(self, sockpath, timeout):
320 def __init__(self, sockpath, timeout, watchman_exe):
321 321 self.sockpath = sockpath
322 322 self.timeout = timeout
323 323
@@ -397,7 +397,7 b' def _get_overlapped_result_ex_impl(pipe,'
397 397 class WindowsNamedPipeTransport(Transport):
398 398 """ connect to a named pipe """
399 399
400 def __init__(self, sockpath, timeout):
400 def __init__(self, sockpath, timeout, watchman_exe):
401 401 self.sockpath = sockpath
402 402 self.timeout = int(math.ceil(timeout * 1000))
403 403 self._iobuf = None
@@ -563,9 +563,10 b' class CLIProcessTransport(Transport):'
563 563 proc = None
564 564 closed = True
565 565
566 def __init__(self, sockpath, timeout):
566 def __init__(self, sockpath, timeout, watchman_exe):
567 567 self.sockpath = sockpath
568 568 self.timeout = timeout
569 self.watchman_exe = watchman_exe
569 570
570 571 def close(self):
571 572 if self.proc:
@@ -579,7 +580,7 b' class CLIProcessTransport(Transport):'
579 580 if self.proc:
580 581 return self.proc
581 582 args = [
582 'watchman',
583 self.watchman_exe,
583 584 '--sockname={0}'.format(self.sockpath),
584 585 '--logfile=/BOGUS',
585 586 '--statefile=/BOGUS',
@@ -756,6 +757,7 b' class client(object):'
756 757 unilateral = ['log', 'subscription']
757 758 tport = None
758 759 useImmutableBser = None
760 watchman_exe = None
759 761
760 762 def __init__(self,
761 763 sockpath=None,
@@ -763,10 +765,12 b' class client(object):'
763 765 transport=None,
764 766 sendEncoding=None,
765 767 recvEncoding=None,
766 useImmutableBser=False):
768 useImmutableBser=False,
769 watchman_exe=None):
767 770 self.sockpath = sockpath
768 771 self.timeout = timeout
769 772 self.useImmutableBser = useImmutableBser
773 self.watchman_exe = watchman_exe
770 774
771 775 if inspect.isclass(transport) and issubclass(transport, Transport):
772 776 self.transport = transport
@@ -817,7 +821,7 b' class client(object):'
817 821 if path:
818 822 return path
819 823
820 cmd = ['watchman', '--output-encoding=bser', 'get-sockname']
824 cmd = [self.watchman_exe, '--output-encoding=bser', 'get-sockname']
821 825 try:
822 826 args = dict(stdout=subprocess.PIPE,
823 827 stderr=subprocess.PIPE,
@@ -858,7 +862,7 b' class client(object):'
858 862 if self.sockpath is None:
859 863 self.sockpath = self._resolvesockname()
860 864
861 self.tport = self.transport(self.sockpath, self.timeout)
865 self.tport = self.transport(self.sockpath, self.timeout, self.watchman_exe)
862 866 self.sendConn = self.sendCodec(self.tport)
863 867 self.recvConn = self.recvCodec(self.tport)
864 868
@@ -82,9 +82,11 b' class client(object):'
82 82 try:
83 83 if self._watchmanclient is None:
84 84 self._firsttime = False
85 watchman_exe = self._ui.configpath('fsmonitor', 'watchman_exe')
85 86 self._watchmanclient = pywatchman.client(
86 87 timeout=self._timeout,
87 useImmutableBser=True)
88 useImmutableBser=True,
89 watchman_exe=watchman_exe)
88 90 return self._watchmanclient.query(*watchmanargs)
89 91 except pywatchman.CommandError as ex:
90 92 if 'unable to resolve root' in ex.msg:
General Comments 0
You need to be logged in to leave comments. Login now