Patchwork D5586: watchman: add verbose config knob

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2019, 5:40 p.m.
Message ID <a31a6314c2e8584f91094a6c092c806b@localhost.localdomain>
Download mbox | patch
Permalink /patch/37983/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2019, 5:40 p.m.
lothiraldan updated this revision to Diff 13411.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5586?vs=13222&id=13411

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

AFFECTED FILES
  hgext/fsmonitor/__init__.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py
--- a/hgext/fsmonitor/__init__.py
+++ b/hgext/fsmonitor/__init__.py
@@ -161,6 +161,9 @@ 
 configitem('fsmonitor', 'blacklistusers',
     default=list,
 )
+configitem('hgwatchman', 'verbose',
+    default=True,
+)
 configitem('experimental', 'fsmonitor.transaction_notify',
     default=False,
 )
@@ -172,11 +175,14 @@ 
 def _handleunavailable(ui, state, ex):
     """Exception handler for Watchman interaction exceptions"""
     if isinstance(ex, watchmanclient.Unavailable):
-        if ex.warn:
+        # experimental config: hgwatchman.verbose
+        if ex.warn and ui.configbool('hgwatchman', 'verbose'):
             ui.warn(str(ex) + '\n')
         if ex.invalidate:
             state.invalidate()
-        ui.log('fsmonitor', 'Watchman unavailable: %s\n', ex.msg)
+        # experimental config: hgwatchman.verbose
+        if ui.configbool('hgwatchman','verbose'):
+            ui.log('fsmonitor', 'Watchman unavailable: %s\n', ex.msg)
     else:
         ui.log('fsmonitor', 'Watchman exception: %s\n', ex)