diff mercurial/commands.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 bdfb524d728a
children d17f19d84fd3
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Mar 06 17:34:49 2006 +0100
+++ b/mercurial/commands.py	Mon Mar 06 17:47:41 2006 +0100
@@ -780,7 +780,7 @@
     f.close()
 
     if not opts['noupdate']:
-        update(ui, repo)
+        update(repo.ui, repo)
 
     d.close()
 
@@ -1067,6 +1067,7 @@
     """show combined config settings from all hgrc files"""
     try:
         repo = hg.repository(ui)
+        ui = repo.ui
     except hg.RepoError:
         pass
     for section, name, value in ui.walkconfig():
@@ -1777,7 +1778,8 @@
     and $HOME/.hgrc.  If run inside a repository, .hg/hgrc is used, too.
     """
     try:
-        repo = hg.repository(ui=ui)
+        repo = hg.repository(ui)
+        ui = repo.ui
     except hg.RepoError:
         pass
 
@@ -2852,7 +2854,8 @@
 
             if cmd not in norepo.split():
                 path = options["repository"] or ""
-                repo = hg.repository(ui=u, path=path)
+                repo = hg.repository(u, path=path)
+                u = repo.ui
                 for x in external:
                     if hasattr(x, 'reposetup'):
                         x.reposetup(u, repo)