Patchwork [01,of,10] repo: repo isolation, do not pass on repo.ui for creating new repos

login
register
mail settings
Submitter Simon Heimberg
Date March 22, 2013, 1:20 a.m.
Message ID <fb7b2ce309b0d3770841.1363915251@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1158/
State Accepted
Commit f0564402d05915f8867fc1bf2371fce0fa5aa888
Headers show

Comments

Simon Heimberg - March 22, 2013, 1:20 a.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1349898949 -7200
# Node ID fb7b2ce309b0d37708414db7db4c7191965ccdac
# Parent  d93e67bb58fae389299c54dfc43a2f879f177079
repo: 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.
This is done too when recreating a repo. The repo configuration is reread
anyway. And now deleted repo configuration does not persist.

Patch

diff -r d93e67bb58fa -r fb7b2ce309b0 hgext/keyword.py
--- a/hgext/keyword.py	Son Mär 10 19:59:00 2013 +0100
+++ b/hgext/keyword.py	Mit Okt 10 21:55:49 2012 +0200
@@ -384,7 +384,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 d93e67bb58fa -r fb7b2ce309b0 hgext/relink.py
--- a/hgext/relink.py	Son Mär 10 19:59:00 2013 +0100
+++ 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 d93e67bb58fa -r fb7b2ce309b0 hgext/share.py
--- a/hgext/share.py	Son Mär 10 19:59:00 2013 +0100
+++ 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 d93e67bb58fa -r fb7b2ce309b0 mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py	Son Mär 10 19:59:00 2013 +0100
+++ b/mercurial/bundlerepo.py	Mit Okt 10 21:55:49 2012 +0200
@@ -360,7 +360,8 @@ 
             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()
     if localrepo: