@@ -407,11 +407,23 @@ def __init__(self, baseui, path, create=False):
407
407
if create :
408
408
bindings .repo .repo .initialize (path , baseui ._rcfg )
409
409
410
+ if not bindings .identity .sniffdir (path ):
411
+ raise errormod .RepoError (_ ("repository %s not found" ) % path )
412
+
410
413
self ._containscount = 0
411
414
self .requirements = set ()
412
415
self .storerequirements = set ()
416
+
413
417
# wvfs: rooted at the repository root, used to access the working copy
414
418
self .wvfs = vfsmod .vfs (path , expandpath = True , realpath = True , cacheaudited = False )
419
+ self .root = self .wvfs .base
420
+
421
+ self .baseui = baseui
422
+ self .ui = baseui .copy ()
423
+ self .ui .loadrepoconfig (self .root )
424
+
425
+ self ._rsrepo = bindings .repo .repo (self .root , self .ui ._rcfg )
426
+
415
427
# localvfs: rooted at .hg, used to access repo files outside of
416
428
# the store that are local to this working copy.
417
429
self .localvfs = None
@@ -422,7 +434,6 @@ def __init__(self, baseui, path, create=False):
422
434
# If this is a shared repository, this vfs may point to another
423
435
# repository's .hg/store directory.
424
436
self .svfs = None
425
- self .root = self .wvfs .base
426
437
self .path = self .wvfs .join (".hg" )
427
438
self .origroot = path
428
439
# This is only used by context.workingctx.match in order to
@@ -431,8 +442,6 @@ def __init__(self, baseui, path, create=False):
431
442
# This is only used by context.basectx.match in order to detect
432
443
# files in forbidden paths..
433
444
self .nofsauditor = pathutil .pathauditor (self .root , realfs = False , cached = True )
434
- self .baseui = baseui
435
- self .ui = baseui .copy ()
436
445
self .localvfs = vfsmod .vfs (self .path , cacheaudited = True )
437
446
if self .ui .configbool ("devel" , "all-warnings" ) or self .ui .configbool (
438
447
"devel" , "check-locks"
@@ -444,14 +453,6 @@ def __init__(self, baseui, path, create=False):
444
453
# This list it to be filled by extension during repo setup
445
454
self ._phasedefaults = []
446
455
447
- if not self .localvfs .isdir ():
448
- raise errormod .RepoError (_ ("repository %s not found" ) % path )
449
-
450
- self .ui .loadrepoconfig (self .root )
451
-
452
- # Setting the inner Rust repo should only be done when the filesystem actually exists
453
- self ._rsrepo = bindings .repo .repo (self .root , self .ui ._rcfg )
454
-
455
456
self ._loadextensions ()
456
457
457
458
cacheaudited = self .ui .configbool ("unsafe" , "wvfsauditorcache" )
0 commit comments