[PATCH 8 of 8] more repo isolation, do not pass on repo.ui for creating new repos

Simon Heimberg simohe at besonet.ch
Mon Oct 22 04:56:02 CDT 2012


# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1349898949 -7200
# Node ID a00e86ad71257689073fb2ed45015830f5c0d91f
# Parent  08562660dc781b82b2f6a324d7499fdd3dfec9b9
more repo isolation, do not pass on repo.ui for creating new repos

A repo should not get the configuration from an other repo, so create it with
the global configuration in repo.baseui.
The same is done when recreating the same repo. The repo configuration is reread
anyway. And now deleted repo configuration does not persist.

diff -r 08562660dc78 -r a00e86ad7125 hgext/keyword.py
--- a/hgext/keyword.py	Mit Okt 10 01:18:06 2012 +0200
+++ b/hgext/keyword.py	Mit Okt 10 21:55:49 2012 +0200
@@ -383,7 +383,7 @@
     fn = 'demo.txt'
     tmpdir = tempfile.mkdtemp('', 'kwdemo.')
     ui.note(_('creating temporary repository at %s\n') % tmpdir)
-    repo = localrepo.localrepository(ui, tmpdir, True)
+    repo = localrepo.localrepository(repo.baseui, tmpdir, True)
     ui.setconfig('keyword', fn, '')
     svn = ui.configbool('keywordset', 'svn')
     # explicitly set keywordset for demo output
diff -r 08562660dc78 -r a00e86ad7125 hgext/relink.py
--- a/hgext/relink.py	Mit Okt 10 01:18:06 2012 +0200
+++ b/hgext/relink.py	Mit Okt 10 21:55:49 2012 +0200
@@ -41,7 +41,7 @@
     if (not util.safehasattr(util, 'samefile') or
         not util.safehasattr(util, 'samedevice')):
         raise util.Abort(_('hardlinks are not supported on this system'))
-    src = hg.repository(ui, ui.expandpath(origin or 'default-relink',
+    src = hg.repository(repo.baseui, ui.expandpath(origin or 'default-relink',
                                           origin or 'default'))
     ui.status(_('relinking %s to %s\n') % (src.store.path, repo.store.path))
     if repo.root == src.root:
diff -r 08562660dc78 -r a00e86ad7125 hgext/share.py
--- a/hgext/share.py	Mit Okt 10 01:18:06 2012 +0200
+++ b/hgext/share.py	Mit Okt 10 21:55:49 2012 +0200
@@ -59,7 +59,7 @@
         lock and lock.release()
 
     # update store, spath, sopener and sjoin of repo
-    repo.__init__(ui, repo.root)
+    repo.__init__(repo.baseui, repo.root)
 
 cmdtable = {
     "share":
diff -r 08562660dc78 -r a00e86ad7125 mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py	Mit Okt 10 01:18:06 2012 +0200
+++ b/mercurial/bundlerepo.py	Mit Okt 10 21:55:49 2012 +0200
@@ -370,7 +370,7 @@
             bundle = None
         if not localrepo:
             # use the created uncompressed bundlerepo
-            localrepo = bundlerepo = bundlerepository(ui, repo.root, fname)
+            localrepo = bundlerepo = bundlerepository(repo.baseui, repo.root, fname)
             # this repo contains local and other now, so filter out local again
             common = repo.heads()
 
diff -r 08562660dc78 -r a00e86ad7125 mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Mit Okt 10 01:18:06 2012 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	Mit Okt 10 21:55:49 2012 +0200
@@ -70,7 +70,7 @@
         if st.st_mtime != self.mtime or st.st_size != self.size:
             self.mtime = st.st_mtime
             self.size = st.st_size
-            self.repo = hg.repository(self.repo.ui, self.repo.root)
+            self.repo = hg.repository(self.repo.baseui, self.repo.root)
             self.maxchanges = int(self.config("web", "maxchanges", 10))
             self.stripecount = int(self.config("web", "stripes", 1))
             self.maxshortchanges = int(self.config("web", "maxshortchanges",


More information about the Mercurial-devel mailing list