comparison mercurial/subrepo.py @ 23573:3fec2a3c768b

subrepo: reset 'self.ui' to the subrepo copy of 'ui' in the hgsubrepo class Creation of the subrepo's '_repo' object creates a new 'ui' by combining the parent repo's 'baseui' and reading in the subrepo's hgrc file. This simply avoids 'self.ui' and 'self._repo.ui' pointing to different objects, which seems like a potential source of bugs. Git and Svn subrepos are unchanged, because they don't have their own ui, and have always used their parent's for their configuration.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 13 Dec 2014 20:43:01 -0500
parents 40e62fbd7356
children faa3d6af154e
comparison
equal deleted inserted replaced
23572:40e62fbd7356 23573:3fec2a3c768b
521 self._state = state 521 self._state = state
522 r = ctx._repo 522 r = ctx._repo
523 root = r.wjoin(path) 523 root = r.wjoin(path)
524 create = not r.wvfs.exists('%s/.hg' % path) 524 create = not r.wvfs.exists('%s/.hg' % path)
525 self._repo = hg.repository(r.baseui, root, create=create) 525 self._repo = hg.repository(r.baseui, root, create=create)
526 self.ui = self._repo.ui
526 for s, k in [('ui', 'commitsubrepos')]: 527 for s, k in [('ui', 'commitsubrepos')]:
527 v = r.ui.config(s, k) 528 v = r.ui.config(s, k)
528 if v: 529 if v:
529 self._repo.ui.setconfig(s, k, v, 'subrepo') 530 self._repo.ui.setconfig(s, k, v, 'subrepo')
530 self._repo.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo') 531 self._repo.ui.setconfig('ui', '_usedassubrepo', 'True', 'subrepo')