[PATCH 6 of 7] repo: repo isolation, do not pass on repo.ui for creating new repos
Simon Heimberg
simohe at besonet.ch
Wed Oct 24 22:41:18 UTC 2012
# HG changeset patch
# User Simon Heimberg <simohe at besonet.ch>
# Date 1349898949 -7200
# Node ID 74e7ed12a586de71e527862b20587c365251255c
# Parent d28dc9d14593a62c1747944e42e424333ca6d719
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.
diff -r d28dc9d14593 -r 74e7ed12a586 hgext/keyword.py
--- a/hgext/keyword.py Don Okt 04 19:46:42 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 d28dc9d14593 -r 74e7ed12a586 hgext/relink.py
--- a/hgext/relink.py Don Okt 04 19:46:42 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 d28dc9d14593 -r 74e7ed12a586 hgext/share.py
--- a/hgext/share.py Don Okt 04 19:46:42 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 d28dc9d14593 -r 74e7ed12a586 mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py Don Okt 04 19:46:42 2012 +0200
+++ b/mercurial/bundlerepo.py Mit Okt 10 21:55:49 2012 +0200
@@ -370,7 +370,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()
diff -r d28dc9d14593 -r 74e7ed12a586 mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py Don Okt 04 19:46:42 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