Show More
@@ -146,7 +146,7 b' def featuresetup(ui, supported):' | |||
|
146 | 146 | supported |= {'largefiles'} |
|
147 | 147 | |
|
148 | 148 | def uisetup(ui): |
|
149 |
localrepo |
|
|
149 | localrepo.featuresetupfuncs.add(featuresetup) | |
|
150 | 150 | hg.wirepeersetupfuncs.append(proto.wirereposetup) |
|
151 | 151 | uisetupmod.uisetup(ui) |
|
152 | 152 |
@@ -199,7 +199,7 b' def featuresetup(ui, supported):' | |||
|
199 | 199 | supported |= {'lfs'} |
|
200 | 200 | |
|
201 | 201 | def uisetup(ui): |
|
202 |
localrepo |
|
|
202 | localrepo.featuresetupfuncs.add(featuresetup) | |
|
203 | 203 | |
|
204 | 204 | def reposetup(ui, repo): |
|
205 | 205 | # Nothing to do with a remote repo |
@@ -309,6 +309,15 b' class locallegacypeer(repository.legacyp' | |||
|
309 | 309 | # clients. |
|
310 | 310 | REVLOGV2_REQUIREMENT = 'exp-revlogv2.0' |
|
311 | 311 | |
|
312 | # Functions receiving (ui, features) that extensions can register to impact | |
|
313 | # the ability to load repositories with custom requirements. Only | |
|
314 | # functions defined in loaded extensions are called. | |
|
315 | # | |
|
316 | # The function receives a set of requirement strings that the repository | |
|
317 | # is capable of opening. Functions will typically add elements to the | |
|
318 | # set to reflect that the extension knows how to handle that requirements. | |
|
319 | featuresetupfuncs = set() | |
|
320 | ||
|
312 | 321 | class localrepository(object): |
|
313 | 322 | |
|
314 | 323 | # obsolete experimental requirements: |
@@ -336,10 +345,6 b' class localrepository(object):' | |||
|
336 | 345 | 'treemanifest', |
|
337 | 346 | } |
|
338 | 347 | |
|
339 | # a list of (ui, featureset) functions. | |
|
340 | # only functions defined in module of enabled extensions are invoked | |
|
341 | featuresetupfuncs = set() | |
|
342 | ||
|
343 | 348 | # list of prefix for file which can be written without 'wlock' |
|
344 | 349 | # Extensions should extend this list when needed |
|
345 | 350 | _wlockfreeprefix = { |
@@ -399,11 +404,11 b' class localrepository(object):' | |||
|
399 | 404 | except IOError: |
|
400 | 405 | pass |
|
401 | 406 | |
|
402 |
if |
|
|
407 | if featuresetupfuncs: | |
|
403 | 408 | self.supported = set(self._basesupported) # use private copy |
|
404 | 409 | extmods = set(m.__name__ for n, m |
|
405 | 410 | in extensions.extensions(self.ui)) |
|
406 |
for setupfunc in |
|
|
411 | for setupfunc in featuresetupfuncs: | |
|
407 | 412 | if setupfunc.__module__ in extmods: |
|
408 | 413 | setupfunc(self.ui, self.supported) |
|
409 | 414 | else: |
@@ -41,7 +41,7 b' another repository of push/pull/clone on' | |||
|
41 | 41 | > supported |= {'featuresetup-test'} |
|
42 | 42 | > return |
|
43 | 43 | > def uisetup(ui): |
|
44 |
> localrepo |
|
|
44 | > localrepo.featuresetupfuncs.add(featuresetup) | |
|
45 | 45 | > EOF |
|
46 | 46 | $ cat > supported/.hg/hgrc <<EOF |
|
47 | 47 | > [extensions] |
General Comments 0
You need to be logged in to leave comments.
Login now