##// END OF EJS Templates
localrepo: create new function for instantiating a local repo object...
Gregory Szorc -
r39978:bfeab472 default
parent child Browse files
Show More
@@ -376,6 +376,18 b" SPARSEREVLOG_REQUIREMENT = 'sparserevlog"
376 376 # set to reflect that the extension knows how to handle that requirements.
377 377 featuresetupfuncs = set()
378 378
379 def makelocalrepository(ui, path, intents=None):
380 """Create a local repository object.
381
382 Given arguments needed to construct a local repository, this function
383 derives a type suitable for representing that repository and returns an
384 instance of it.
385
386 The returned object conforms to the ``repository.completelocalrepository``
387 interface.
388 """
389 return localrepository(ui, path, intents=intents)
390
379 391 @interfaceutil.implementer(repository.completelocalrepository)
380 392 class localrepository(object):
381 393
@@ -2388,7 +2400,7 b' def instance(ui, path, create, intents=N'
2388 2400 if create:
2389 2401 createrepository(ui, localpath, createopts=createopts)
2390 2402
2391 return localrepository(ui, localpath, intents=intents)
2403 return makelocalrepository(ui, localpath, intents=intents)
2392 2404
2393 2405 def islocal(path):
2394 2406 return True
@@ -144,7 +144,7 b' def main():'
144 144
145 145 ziverify.verifyClass(repository.completelocalrepository,
146 146 localrepo.localrepository)
147 repo = localrepo.localrepository(ui, rootdir)
147 repo = localrepo.makelocalrepository(ui, rootdir)
148 148 checkzobject(repo)
149 149
150 150 ziverify.verifyClass(wireprototypes.baseprotocolhandler,
General Comments 0
You need to be logged in to leave comments. Login now