[PATCH 4 of 5] localrepo.__init__: move code around

Benoit Boissinot benoit.boissinot at ens-lyon.org
Fri Dec 1 11:35:33 UTC 2006


# HG changeset patch
# User Benoit Boissinot <benoit.boissinot at ens-lyon.org>
# Date 1164969198 -3600
# Node ID 9ace08ca67ea2ba16f1a454d9573125473e87e46
# Parent  92e3dc18710cbb78c71763215692ac0f68345a54
localrepo.__init__: move code around

diff -r 92e3dc18710c -r 9ace08ca67ea mercurial/localrepo.py
--- a/mercurial/localrepo.py	Fri Dec 01 11:29:27 2006 +0100
+++ b/mercurial/localrepo.py	Fri Dec 01 11:33:18 2006 +0100
@@ -33,6 +33,12 @@ class localrepository(repo.repository):
         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.sopener = util.opener(self.spath)
+        self.wopener = util.opener(self.root)
+
         if not os.path.isdir(self.path):
             if create:
                 if not os.path.exists(path):
@@ -45,13 +51,7 @@ class localrepository(repo.repository):
         elif create:
             raise repo.RepoError(_("repository %s already exists") % path)
 
-        self.root = os.path.realpath(path)
-        self.origroot = path
         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:



More information about the Mercurial-devel mailing list