diff --git a/eden/scm/edenscm/hgext/extlib/watchmanclient/__init__.py b/eden/scm/edenscm/hgext/extlib/watchmanclient/__init__.py index 4627328164..49447b4881 100644 --- a/eden/scm/edenscm/hgext/extlib/watchmanclient/__init__.py +++ b/eden/scm/edenscm/hgext/extlib/watchmanclient/__init__.py @@ -81,6 +81,11 @@ class client(object): self._sockpath = sockpath repo.ui.debug("watchman sockpath is set as %s\n" % sockpath) + self._transport = None + if repo.ui.configbool("fsmonitor", "tcp", False): + self._transport = "tcp" + self._tcp_host = repo.ui.config("fsmonitor", "tcp-host", "::1") + self._tcp_port = repo.ui.configint("fsmonitor", "tcp-port", 12300) self._timeout = timeout self._watchmanclient = None self._root = repo.root @@ -123,6 +128,8 @@ class client(object): self._firsttime = False self._watchmanclient = pywatchman.client( sockpath=self._sockpath, + transport=self._transport, + tcpAddress=(self._tcp_host, self._tcp_port), timeout=self._timeout, recvEncoding="bser-v1", sendEncoding="bser-v1", diff --git a/eden/scm/edenscm/hgext/fsmonitor/__init__.py b/eden/scm/edenscm/hgext/fsmonitor/__init__.py index 36dba14df8..574351f7ab 100644 --- a/eden/scm/edenscm/hgext/fsmonitor/__init__.py +++ b/eden/scm/edenscm/hgext/fsmonitor/__init__.py @@ -215,6 +215,9 @@ configitem("fsmonitor", "walk_on_invalidate", default=False) configitem("fsmonitor", "watchman-changed-file-threshold", default=200) configitem("fsmonitor", "warn-fresh-instance", default=False) configitem("fsmonitor", "fallback-on-watchman-exception", default=True) +configitem("fsmonitor", "tcp", default=False) +configitem("fsmonitor", "tcp-host", default="::1") +configitem("fsmonitor", "tcp-port", default=12300) # This extension is incompatible with the following blacklisted extensions # and will disable itself when encountering one of these: diff --git a/eden/scm/tests/test-check-config.t b/eden/scm/tests/test-check-config.t index 419839f1c8..4b64674979 100644 --- a/eden/scm/tests/test-check-config.t +++ b/eden/scm/tests/test-check-config.t @@ -60,6 +60,9 @@ New errors are not allowed. Warnings are strongly discouraged. undocumented: fbscmquery.gitcallsigns (list) undocumented: fbscmquery.reponame (str) undocumented: format.usehgsql (bool) + undocumented: fsmonitor.tcp (bool) + undocumented: fsmonitor.tcp-host (str) ["::1"] + undocumented: fsmonitor.tcp-port (int) [12300] undocumented: git.public (list) undocumented: grep.biggrepcorpus (str) undocumented: grep.biggreptier (str) ["biggrep.master"]