diff --git a/hgext/fsmonitor/__init__.py b/hgext/fsmonitor/__init__.py --- a/hgext/fsmonitor/__init__.py +++ b/hgext/fsmonitor/__init__.py @@ -777,6 +777,18 @@ 'extension and has been disabled.\n') % ext) return + enabled = None + if 'HGWATCHMAN_ENABLE' in encoding.environ: + enabled = encoding.environ['HGWATCHMAN_ENABLE'].lower() + + if enabled == 'true' or enabled == '': + pass + elif enabled == 'false': + return + else: + if not ui.interactive(): + return + if repo.local(): # We don't work with subrepos either. #