diff mercurial/localrepo.py @ 1839:876e4e6ad82b

Create local ui object per repository, so .hg/hgrc don't get mixed. This is needed for hooks, but may be important for other settings, too. Fixes issue113, also integrated push-hook-lock.sh as a test case for this.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 06 Mar 2006 17:47:41 +0100
parents 429bf036f2cb
children 5ac811b720de
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Mar 06 17:34:49 2006 +0100
+++ b/mercurial/localrepo.py	Mon Mar 06 17:47:41 2006 +0100
@@ -10,12 +10,12 @@
 from node import *
 from i18n import gettext as _
 from demandload import *
-demandload(globals(), "re lock transaction tempfile stat mdiff errno")
+demandload(globals(), "re lock transaction tempfile stat mdiff errno ui")
 
 class localrepository(object):
     def __del__(self):
         self.transhandle = None
-    def __init__(self, ui, path=None, create=0):
+    def __init__(self, parentui, path=None, create=0):
         if not path:
             p = os.getcwd()
             while not os.path.isdir(os.path.join(p, ".hg")):
@@ -30,7 +30,7 @@
             raise repo.RepoError(_("repository %s not found") % path)
 
         self.root = os.path.abspath(path)
-        self.ui = ui
+        self.ui = ui.ui(parentui=parentui)
         self.opener = util.opener(self.path)
         self.wopener = util.opener(self.root)
         self.manifest = manifest.manifest(self.opener)
@@ -45,7 +45,7 @@
             os.mkdir(self.path)
             os.mkdir(self.join("data"))
 
-        self.dirstate = dirstate.dirstate(self.opener, ui, self.root)
+        self.dirstate = dirstate.dirstate(self.opener, self.ui, self.root)
         try:
             self.ui.readconfig(self.join("hgrc"))
         except IOError: