changeset 34756:3f3c6d12095d

configitems: register the 'largefiles.patterns' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 13 Oct 2017 22:26:58 +0200
parents 66adbe3c1046
children 8cf0a6cd1ed2
files hgext/largefiles/__init__.py hgext/largefiles/lfcommands.py hgext/largefiles/overrides.py
diffstat 3 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/__init__.py	Fri Oct 13 22:26:03 2017 +0200
+++ b/hgext/largefiles/__init__.py	Fri Oct 13 22:26:58 2017 +0200
@@ -133,6 +133,9 @@
 configitem('largefiles', 'minsize',
     default=configitems.dynamicdefault,
 )
+configitem('largefiles', 'patterns',
+    default=list,
+)
 reposetup = reposetup.reposetup
 
 def featuresetup(ui, supported):
--- a/hgext/largefiles/lfcommands.py	Fri Oct 13 22:26:03 2017 +0200
+++ b/hgext/largefiles/lfcommands.py	Fri Oct 13 22:26:58 2017 +0200
@@ -109,7 +109,7 @@
             lfiles = set()
             normalfiles = set()
             if not pats:
-                pats = ui.configlist(lfutil.longname, 'patterns', default=[])
+                pats = ui.configlist(lfutil.longname, 'patterns')
             if pats:
                 matcher = matchmod.match(rsrc.root, '', list(pats))
             else:
--- a/hgext/largefiles/overrides.py	Fri Oct 13 22:26:03 2017 +0200
+++ b/hgext/largefiles/overrides.py	Fri Oct 13 22:26:58 2017 +0200
@@ -111,7 +111,7 @@
 
     lfmatcher = None
     if lfutil.islfilesrepo(repo):
-        lfpats = ui.configlist(lfutil.longname, 'patterns', default=[])
+        lfpats = ui.configlist(lfutil.longname, 'patterns')
         if lfpats:
             lfmatcher = matchmod.match(repo.root, '', list(lfpats))