# HG changeset patch # User Gregory Szorc # Date 1506893184 -3600 # Node ID 718f7acd6d5ef76dd33146670557df36e74ee68d # Parent 8337f7772aa2f5132f0fa460c24a94ffdbb7d37e fsmonitor: use configitem We might as well get this out of the way. Differential Revision: https://phab.mercurial-scm.org/D893 diff -r 8337f7772aa2 -r 718f7acd6d5e hgext/fsmonitor/__init__.py --- a/hgext/fsmonitor/__init__.py Sun Oct 01 23:47:16 2017 +0100 +++ b/hgext/fsmonitor/__init__.py Sun Oct 01 22:26:24 2017 +0100 @@ -107,6 +107,7 @@ merge, pathutil, pycompat, + registrar, scmutil, util, ) @@ -124,6 +125,22 @@ # leave the attribute unspecified. testedwith = 'ships-with-hg-core' +configtable = {} +configitem = registrar.configitem(configtable) + +configitem('fsmonitor', 'mode', + default='on', +) +configitem('fsmonitor', 'walk_on_invalidate', + default=False, +) +configitem('fsmonitor', 'timeout', + default='2', +) +configitem('fsmonitor', 'blacklistusers', + default=list, +) + # This extension is incompatible with the following blacklisted extensions # and will disable itself when encountering one of these: _blacklist = ['largefiles', 'eol'] diff -r 8337f7772aa2 -r 718f7acd6d5e hgext/fsmonitor/state.py --- a/hgext/fsmonitor/state.py Sun Oct 01 23:47:16 2017 +0100 +++ b/hgext/fsmonitor/state.py Sun Oct 01 22:26:24 2017 +0100 @@ -29,11 +29,10 @@ self._lastclock = None self._identity = util.filestat(None) - self.mode = self._ui.config('fsmonitor', 'mode', default='on') + self.mode = self._ui.config('fsmonitor', 'mode') self.walk_on_invalidate = self._ui.configbool( - 'fsmonitor', 'walk_on_invalidate', False) - self.timeout = float(self._ui.config( - 'fsmonitor', 'timeout', default='2')) + 'fsmonitor', 'walk_on_invalidate') + self.timeout = float(self._ui.config('fsmonitor', 'timeout')) def get(self): try: