subrepo: reset 'self.ui' to the subrepo copy of 'ui' in the hgsubrepo class
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 13 Dec 2014 20:43:01 -0500
changeset 23573 3fec2a3c768b
parent 23572 40e62fbd7356
child 23574 faa3d6af154e
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.
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Sat Dec 13 15:19:38 2014 -0500
+++ b/mercurial/subrepo.py	Sat Dec 13 20:43:01 2014 -0500
@@ -523,6 +523,7 @@
         root = r.wjoin(path)
         create = not r.wvfs.exists('%s/.hg' % path)
         self._repo = hg.repository(r.baseui, root, create=create)
+        self.ui = self._repo.ui
         for s, k in [('ui', 'commitsubrepos')]:
             v = r.ui.config(s, k)
             if v: