repo: set up ui and extensions earlier
authorMatt Mackall <mpm@selenic.com>
Sat, 13 Jun 2009 14:44:59 -0500
changeset 8797 9ed150d2fbd5
parent 8796 2bcef677a6c3
child 8798 92fc57c9f9d1
repo: set up ui and extensions earlier
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Jun 10 19:11:49 2009 -0400
+++ b/mercurial/localrepo.py	Sat Jun 13 14:44:59 2009 -0500
@@ -28,6 +28,14 @@
         self.origroot = path
         self.opener = util.opener(self.path)
         self.wopener = util.opener(self.root)
+        self.baseui = baseui
+        self.ui = baseui.copy()
+
+        try:
+            self.ui.readconfig(self.join("hgrc"), self.root)
+            extensions.loadall(self.ui)
+        except IOError:
+            pass
 
         if not os.path.isdir(self.path):
             if create:
@@ -35,10 +43,10 @@
                     os.mkdir(path)
                 os.mkdir(self.path)
                 requirements = ["revlogv1"]
-                if baseui.configbool('format', 'usestore', True):
+                if self.ui.configbool('format', 'usestore', True):
                     os.mkdir(os.path.join(self.path, "store"))
                     requirements.append("store")
-                    if baseui.configbool('format', 'usefncache', True):
+                    if self.ui.configbool('format', 'usefncache', True):
                         requirements.append("fncache")
                     # create an invalid changelog
                     self.opener("00changelog.i", "a").write(
@@ -70,14 +78,6 @@
         self.sjoin = self.store.join
         self.opener.createmode = self.store.createmode
 
-        self.baseui = baseui
-        self.ui = baseui.copy()
-        try:
-            self.ui.readconfig(self.join("hgrc"), self.root)
-            extensions.loadall(self.ui)
-        except IOError:
-            pass
-
         self.tagscache = None
         self._tagstypecache = None
         self.branchcache = None