Mercurial > hg
comparison mercurial/subrepo.py @ 17873:573bec4ab7ba stable
subrepo: isolate configuration between each repositories in subrepo tree
Before this patch, repository local configurations are not isolated
between repositories in subrepo tree, because "localrepository"
objects for each subrepositories are created with "ui" instance of the
parent of each ones.
So, local configuration of the parent or higher repositories are
visible also in children or lower ones.
This patch uses "baseui" instead of "ui" to create repository object:
the former contains only global configuration.
This patch also copies 'ui.commitsubrepos' configuration to commit
recursively in subrepo tree, because it may be set in not
"repo.baseui" but "repo.ui".
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 29 Sep 2012 20:11:24 +0900 |
parents | 35674bd95200 |
children | 2ba70eec1cf0 |
comparison
equal
deleted
inserted
replaced
17872:7d4e98bf114d | 17873:573bec4ab7ba |
---|---|
393 root = r.wjoin(path) | 393 root = r.wjoin(path) |
394 create = False | 394 create = False |
395 if not os.path.exists(os.path.join(root, '.hg')): | 395 if not os.path.exists(os.path.join(root, '.hg')): |
396 create = True | 396 create = True |
397 util.makedirs(root) | 397 util.makedirs(root) |
398 self._repo = hg.repository(r.ui, root, create=create) | 398 self._repo = hg.repository(r.baseui, root, create=create) |
399 for s, k in [('ui', 'commitsubrepos')]: | |
400 v = r.ui.config(s, k) | |
401 if v: | |
402 self._repo.ui.setconfig(s, k, v) | |
399 self._initrepo(r, state[0], create) | 403 self._initrepo(r, state[0], create) |
400 | 404 |
401 def _initrepo(self, parentrepo, source, create): | 405 def _initrepo(self, parentrepo, source, create): |
402 self._repo._subparent = parentrepo | 406 self._repo._subparent = parentrepo |
403 self._repo._subsource = source | 407 self._repo._subsource = source |