Patchwork D6680: fsmonitor: refactor watchmanclient.client to accept ui and repo path

login
register
mail settings
Submitter phabricator
Date July 24, 2019, 9:32 a.m.
Message ID <bf98c48b45129ea044980ef0db5b89e1@localhost.localdomain>
Download mbox | patch
Permalink /patch/41037/
State Not Applicable
Headers show

Comments

phabricator - July 24, 2019, 9:32 a.m.
Closed by commit rHGf3c594ddecb7: fsmonitor: refactor watchmanclient.client to accept ui and repo path (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6680?vs=16022&id=16033

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6680/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6680

AFFECTED FILES
  hgext/fsmonitor/__init__.py
  hgext/fsmonitor/watchmanclient.py

CHANGE DETAILS




To: durin42, #hg-reviewers, pulkit
Cc: mjpieters, mercurial-devel

Patch

diff --git a/hgext/fsmonitor/watchmanclient.py b/hgext/fsmonitor/watchmanclient.py
--- a/hgext/fsmonitor/watchmanclient.py
+++ b/hgext/fsmonitor/watchmanclient.py
@@ -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):
diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -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