# HG changeset patch # User Boris Feld # Date 1545408751 -3600 # Node ID 18adb747a33219717851d5f1887002d42f9a71b8 # Parent fa471151d26981a3ff978369e29630637c9a23af watchman: add verbose config knob This new config knob allows to silent watchman log and warning messages when watchman is unavailable. Differential Revision: https://phab.mercurial-scm.org/D5586 diff -r fa471151d269 -r 18adb747a332 hgext/fsmonitor/__init__.py --- a/hgext/fsmonitor/__init__.py Tue Jan 29 22:59:15 2019 -0800 +++ b/hgext/fsmonitor/__init__.py Fri Dec 21 17:12:31 2018 +0100 @@ -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)