Patchwork D893: fsmonitor: use configitem

login
register
mail settings
Submitter phabricator
Date Oct. 4, 2017, 2:55 p.m.
Message ID <431798c2609e6775578e44181663d0e0@localhost.localdomain>
Download mbox | patch
Permalink /patch/24496/
State Not Applicable
Headers show

Comments

phabricator - Oct. 4, 2017, 2:55 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG718f7acd6d5e: fsmonitor: use configitem (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D893?vs=2314&id=2417

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

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

CHANGE DETAILS




To: indygreg, #hg-reviewers, mbthomas, krbullock
Cc: mercurial-devel

Patch

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