diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -1905,7 +1905,7 @@ subrepositories feature. See also :hg:`h When disallowed, any commands including :hg:`update` will fail if subrepositories are involved. - (default: `hg, git, svn`) + (default: `hg`) ``templatealias`` ----------------- diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -366,7 +366,7 @@ def _auditsubrepopath(repo, path): raise error.Abort(_("subrepo '%s' traverses symbolic link") % path) def _checktype(ui, kind): - if kind not in ui.configlist('subrepos', 'allowed', ['hg', 'git', 'svn']): + if kind not in ui.configlist('subrepos', 'allowed', ['hg']): raise error.Abort(_("subrepo type %s not allowed") % kind, hint=_("see 'hg help config.subrepos' for details")) if kind not in types: diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t --- a/tests/test-convert-git.t +++ b/tests/test-convert-git.t @@ -6,6 +6,10 @@ $ echo "autocrlf = false" >> $HOME/.gitconfig $ echo "[extensions]" >> $HGRCPATH $ echo "convert=" >> $HGRCPATH + $ cat >> $HGRCPATH < [subrepos] + > allowed = hg, git + > EOF $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE diff --git a/tests/test-mq-subrepo-svn.t b/tests/test-mq-subrepo-svn.t --- a/tests/test-mq-subrepo-svn.t +++ b/tests/test-mq-subrepo-svn.t @@ -5,6 +5,8 @@ > mq = > [diff] > nodates = 1 + > [subrepos] + > allowed = hg, svn > EOF fn to create new repository, and cd into it diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t --- a/tests/test-subrepo-git.t +++ b/tests/test-subrepo-git.t @@ -41,7 +41,23 @@ add subrepo clone $ echo 's = [git]../gitroot' > .hgsub $ git clone -q ../gitroot s $ hg add .hgsub + +git subrepo is disabled by default + $ hg commit -m 'new git subrepo' + abort: subrepo type git not allowed + (see 'hg help config.subrepos' for details) + [255] + +so enable it + + $ cat >> $HGRCPATH < [subrepos] + > allowed = hg, git + > EOF + + $ hg commit -m 'new git subrepo' + $ hg debugsub path s source ../gitroot diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t --- a/tests/test-subrepo-svn.t +++ b/tests/test-subrepo-svn.t @@ -57,6 +57,21 @@ add first svn sub with leading whitespac $ mkdir subdir $ svn co --quiet "$SVNREPOURL"/src subdir/s $ hg add .hgsub + +svn subrepo is disabled by default + + $ hg ci -m1 + abort: subrepo type svn not allowed + (see 'hg help config.subrepos' for details) + [255] + +so enable it + + $ cat >> $HGRCPATH < [subrepos] + > allowed = hg, svn + > EOF + $ hg ci -m1 make sure we avoid empty commits (issue2445)