diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -569,6 +569,11 @@ class hgsubrepo(abstractsubrepo): root = r.wjoin(path) create = not r.wvfs.exists('%s/.hg' % path) self._repo = hg.repository(r.baseui, root, create=create) + + # Propagate the parent's --hidden option + if r is r.unfiltered(): + self._repo = self._repo.unfiltered() + self.ui = self._repo.ui for s, k in [('ui', 'commitsubrepos')]: v = r.ui.config(s, k) diff --git a/tests/test-subrepo-missing.t b/tests/test-subrepo-missing.t --- a/tests/test-subrepo-missing.t +++ b/tests/test-subrepo-missing.t @@ -96,4 +96,14 @@ check that we can update parent repo wit revision 102a90ea7b4a in subrepo subrepo is hidden 1 files updated, 0 files merged, 0 files removed, 0 files unresolved +check that --hidden is propagated to the subrepo + + $ hg -R subrepo up tip + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg ci -m 'commit with amended subrepo' + $ echo bar > subrepo/a + $ hg -R subrepo ci --amend -m "amend a (again)" + $ hg --hidden cat subrepo/a + foo + $ cd ..