Show More
@@ -155,10 +155,11 b' def _rejectunicode(name, xs):' | |||||
155 | elif isinstance(xs, dict): |
|
155 | elif isinstance(xs, dict): | |
156 | for k, v in xs.items(): |
|
156 | for k, v in xs.items(): | |
157 | _rejectunicode(name, k) |
|
157 | _rejectunicode(name, k) | |
158 | _rejectunicode(b'%s.%s' % (name, stringutil.forcebytestr(k)), v) |
|
158 | k = pycompat.sysstr(k) | |
159 | elif isinstance(xs, type(u'')): |
|
159 | _rejectunicode('%s.%s' % (name, k), v) | |
|
160 | elif isinstance(xs, str): | |||
160 | raise error.ProgrammingError( |
|
161 | raise error.ProgrammingError( | |
161 | b"unicode %r found in %s" % (xs, name), |
|
162 | b"unicode %r found in %s" % (xs, stringutil.forcebytestr(name)), | |
162 | hint=b"use b'' to make it byte string", |
|
163 | hint=b"use b'' to make it byte string", | |
163 | ) |
|
164 | ) | |
164 |
|
165 | |||
@@ -182,15 +183,15 b' def _validatecmdtable(ui, cmdtable):' | |||||
182 |
|
183 | |||
183 | def _validatetables(ui, mod): |
|
184 | def _validatetables(ui, mod): | |
184 | """Sanity check for loadable tables provided by extension module""" |
|
185 | """Sanity check for loadable tables provided by extension module""" | |
185 |
for t in [ |
|
186 | for t in ['cmdtable', 'colortable', 'configtable']: | |
186 | _rejectunicode(t, getattr(mod, t, {})) |
|
187 | _rejectunicode(t, getattr(mod, t, {})) | |
187 | for t in [ |
|
188 | for t in [ | |
188 |
|
|
189 | 'filesetpredicate', | |
189 |
|
|
190 | 'internalmerge', | |
190 |
|
|
191 | 'revsetpredicate', | |
191 |
|
|
192 | 'templatefilter', | |
192 |
|
|
193 | 'templatefunc', | |
193 |
|
|
194 | 'templatekeyword', | |
194 | ]: |
|
195 | ]: | |
195 | o = getattr(mod, t, None) |
|
196 | o = getattr(mod, t, None) | |
196 | if o: |
|
197 | if o: | |
@@ -349,7 +350,7 b' def loadall(ui, whitelist=None):' | |||||
349 | # |
|
350 | # | |
350 | # This one is for the list of item that must be run before running any setup |
|
351 | # This one is for the list of item that must be run before running any setup | |
351 | earlyextraloaders = [ |
|
352 | earlyextraloaders = [ | |
352 |
( |
|
353 | ('configtable', configitems, 'loadconfigtable'), | |
353 | ] |
|
354 | ] | |
354 |
|
355 | |||
355 | ui.log(b'extension', b'- loading configtable attributes\n') |
|
356 | ui.log(b'extension', b'- loading configtable attributes\n') | |
@@ -434,14 +435,14 b' def loadall(ui, whitelist=None):' | |||||
434 | # which takes (ui, extensionname, extraobj) arguments |
|
435 | # which takes (ui, extensionname, extraobj) arguments | |
435 | ui.log(b'extension', b'- loading extension registration objects\n') |
|
436 | ui.log(b'extension', b'- loading extension registration objects\n') | |
436 | extraloaders = [ |
|
437 | extraloaders = [ | |
437 |
( |
|
438 | ('cmdtable', commands, 'loadcmdtable'), | |
438 |
( |
|
439 | ('colortable', color, 'loadcolortable'), | |
439 |
( |
|
440 | ('filesetpredicate', fileset, 'loadpredicate'), | |
440 |
( |
|
441 | ('internalmerge', filemerge, 'loadinternalmerge'), | |
441 |
( |
|
442 | ('revsetpredicate', revset, 'loadpredicate'), | |
442 |
( |
|
443 | ('templatefilter', templatefilters, 'loadfilter'), | |
443 |
( |
|
444 | ('templatefunc', templatefuncs, 'loadfunction'), | |
444 |
( |
|
445 | ('templatekeyword', templatekw, 'loadkeyword'), | |
445 | ] |
|
446 | ] | |
446 | with util.timedcm('load registration objects') as stats: |
|
447 | with util.timedcm('load registration objects') as stats: | |
447 | _loadextra(ui, newindex, extraloaders) |
|
448 | _loadextra(ui, newindex, extraloaders) |
General Comments 0
You need to be logged in to leave comments.
Login now