changeset 3850:a4457828ca1a

move code around
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sun, 10 Dec 2006 00:06:45 +0100
parents 972d14a5a227
children 8f18e31c4441
files mercurial/localrepo.py
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sun Dec 10 00:06:43 2006 +0100
+++ b/mercurial/localrepo.py	Sun Dec 10 00:06:45 2006 +0100
@@ -30,28 +30,30 @@
                     raise repo.RepoError(_("There is no Mercurial repository"
                                            " here (.hg not found)"))
             path = p
+
         self.path = os.path.join(path, ".hg")
-        self.spath = self.path
+        self.root = os.path.realpath(path)
+        self.origroot = path
+        self.opener = util.opener(self.path)
+        self.wopener = util.opener(self.root)
 
         if not os.path.isdir(self.path):
             if create:
                 if not os.path.exists(path):
                     os.mkdir(path)
                 os.mkdir(self.path)
-                if self.spath != self.path:
-                    os.mkdir(self.spath)
+                #if self.spath != self.path:
+                #    os.mkdir(self.spath)
             else:
                 raise repo.RepoError(_("repository %s not found") % path)
         elif create:
             raise repo.RepoError(_("repository %s already exists") % path)
 
-        self.root = os.path.realpath(path)
-        self.origroot = path
+        # setup store
+        self.spath = self.path
+        self.sopener = util.opener(self.spath)
+
         self.ui = ui.ui(parentui=parentui)
-        self.opener = util.opener(self.path)
-        self.sopener = util.opener(self.spath)
-        self.wopener = util.opener(self.root)
-
         try:
             self.ui.readconfig(self.join("hgrc"), self.root)
         except IOError: