# HG changeset patch # User Augie Fackler # Date 1563906998 14400 # Node ID ab1900323b1d334a4211669cc6f483413b625013 # Parent 12addcc7956cdf8e31a4fb6fa2a186c500e2c2db fsmonitor: refactor watchmanclient.client to accept ui and repo path This will make my next patch simpler. Differential Revision: https://phab.mercurial-scm.org/D6680 diff -r 12addcc7956c -r ab1900323b1d hgext/fsmonitor/__init__.py --- a/hgext/fsmonitor/__init__.py Sun Jul 21 14:42:01 2019 +0900 +++ b/hgext/fsmonitor/__init__.py Tue Jul 23 14:36:38 2019 -0400 @@ -780,7 +780,7 @@ return try: - client = watchmanclient.client(repo) + client = watchmanclient.client(repo.ui, repo._root) except Exception as ex: _handleunavailable(ui, fsmonitorstate, ex) return diff -r 12addcc7956c -r ab1900323b1d hgext/fsmonitor/watchmanclient.py --- a/hgext/fsmonitor/watchmanclient.py Sun Jul 21 14:42:01 2019 +0900 +++ b/hgext/fsmonitor/watchmanclient.py Tue Jul 23 14:36:38 2019 -0400 @@ -33,12 +33,12 @@ super(WatchmanNoRoot, self).__init__(msg) class client(object): - def __init__(self, repo, timeout=1.0): + def __init__(self, ui, root, timeout=1.0): err = None if not self._user: err = "couldn't get user" warn = True - if self._user in repo.ui.configlist('fsmonitor', 'blacklistusers'): + if self._user in ui.configlist('fsmonitor', 'blacklistusers'): err = 'user %s in blacklist' % self._user warn = False @@ -47,8 +47,8 @@ self._timeout = timeout self._watchmanclient = None - self._root = repo.root - self._ui = repo.ui + self._root = root + self._ui = ui self._firsttime = True def settimeout(self, timeout):