comparison hgext/largefiles/__init__.py @ 41059:0ecf58f7c2b2

largefiles: port configitems to exthelper It looks like dynamicdefault was referenced in a non-standard way.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 23 Dec 2018 16:16:13 -0500
parents ecac0006b90e
children 98681293c890
comparison
equal deleted inserted replaced
41058:c61b8dfb07c8 41059:0ecf58f7c2b2
105 command. 105 command.
106 ''' 106 '''
107 from __future__ import absolute_import 107 from __future__ import absolute_import
108 108
109 from mercurial import ( 109 from mercurial import (
110 configitems,
111 exthelper,
110 hg, 112 hg,
111 localrepo, 113 localrepo,
112 registrar,
113 ) 114 )
114 115
115 from . import ( 116 from . import (
116 lfcommands, 117 lfcommands,
117 overrides, 118 overrides,
124 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should 125 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
125 # be specifying the version(s) of Mercurial they are tested with, or 126 # be specifying the version(s) of Mercurial they are tested with, or
126 # leave the attribute unspecified. 127 # leave the attribute unspecified.
127 testedwith = 'ships-with-hg-core' 128 testedwith = 'ships-with-hg-core'
128 129
129 configtable = {} 130 eh = exthelper.exthelper()
130 configitem = registrar.configitem(configtable)
131 131
132 configitem('largefiles', 'minsize', 132 eh.configitem('largefiles', 'minsize',
133 default=configitem.dynamicdefault, 133 default=configitems.dynamicdefault,
134 ) 134 )
135 configitem('largefiles', 'patterns', 135 eh.configitem('largefiles', 'patterns',
136 default=list, 136 default=list,
137 ) 137 )
138 configitem('largefiles', 'usercache', 138 eh.configitem('largefiles', 'usercache',
139 default=None, 139 default=None,
140 ) 140 )
141 141
142 configtable = eh.configtable
142 reposetup = reposetup.reposetup 143 reposetup = reposetup.reposetup
143 144
144 def featuresetup(ui, supported): 145 def featuresetup(ui, supported):
145 # don't die on seeing a repo with the largefiles requirement 146 # don't die on seeing a repo with the largefiles requirement
146 supported |= {'largefiles'} 147 supported |= {'largefiles'}