##// END OF EJS Templates
subrepo: disable git and svn subrepos by default (BC) (SEC)...
Yuya Nishihara -
r34988:846942fd stable
parent child Browse files
Show More
@@ -1905,7 +1905,7 b' subrepositories feature. See also :hg:`h'
1905
1905
1906 When disallowed, any commands including :hg:`update` will fail if
1906 When disallowed, any commands including :hg:`update` will fail if
1907 subrepositories are involved.
1907 subrepositories are involved.
1908 (default: `hg, git, svn`)
1908 (default: `hg`)
1909
1909
1910 ``templatealias``
1910 ``templatealias``
1911 -----------------
1911 -----------------
@@ -366,7 +366,7 b' def _auditsubrepopath(repo, path):'
366 raise error.Abort(_("subrepo '%s' traverses symbolic link") % path)
366 raise error.Abort(_("subrepo '%s' traverses symbolic link") % path)
367
367
368 def _checktype(ui, kind):
368 def _checktype(ui, kind):
369 if kind not in ui.configlist('subrepos', 'allowed', ['hg', 'git', 'svn']):
369 if kind not in ui.configlist('subrepos', 'allowed', ['hg']):
370 raise error.Abort(_("subrepo type %s not allowed") % kind,
370 raise error.Abort(_("subrepo type %s not allowed") % kind,
371 hint=_("see 'hg help config.subrepos' for details"))
371 hint=_("see 'hg help config.subrepos' for details"))
372 if kind not in types:
372 if kind not in types:
@@ -6,6 +6,10 b''
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
7 $ echo "[extensions]" >> $HGRCPATH
7 $ echo "[extensions]" >> $HGRCPATH
8 $ echo "convert=" >> $HGRCPATH
8 $ echo "convert=" >> $HGRCPATH
9 $ cat >> $HGRCPATH <<EOF
10 > [subrepos]
11 > allowed = hg, git
12 > EOF
9 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
13 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
10 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
14 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
11 $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
15 $ GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE
@@ -5,6 +5,8 b''
5 > mq =
5 > mq =
6 > [diff]
6 > [diff]
7 > nodates = 1
7 > nodates = 1
8 > [subrepos]
9 > allowed = hg, svn
8 > EOF
10 > EOF
9
11
10 fn to create new repository, and cd into it
12 fn to create new repository, and cd into it
@@ -41,7 +41,23 b' add subrepo clone'
41 $ echo 's = [git]../gitroot' > .hgsub
41 $ echo 's = [git]../gitroot' > .hgsub
42 $ git clone -q ../gitroot s
42 $ git clone -q ../gitroot s
43 $ hg add .hgsub
43 $ hg add .hgsub
44
45 git subrepo is disabled by default
46
44 $ hg commit -m 'new git subrepo'
47 $ hg commit -m 'new git subrepo'
48 abort: subrepo type git not allowed
49 (see 'hg help config.subrepos' for details)
50 [255]
51
52 so enable it
53
54 $ cat >> $HGRCPATH <<EOF
55 > [subrepos]
56 > allowed = hg, git
57 > EOF
58
59 $ hg commit -m 'new git subrepo'
60
45 $ hg debugsub
61 $ hg debugsub
46 path s
62 path s
47 source ../gitroot
63 source ../gitroot
@@ -57,6 +57,21 b' add first svn sub with leading whitespac'
57 $ mkdir subdir
57 $ mkdir subdir
58 $ svn co --quiet "$SVNREPOURL"/src subdir/s
58 $ svn co --quiet "$SVNREPOURL"/src subdir/s
59 $ hg add .hgsub
59 $ hg add .hgsub
60
61 svn subrepo is disabled by default
62
63 $ hg ci -m1
64 abort: subrepo type svn not allowed
65 (see 'hg help config.subrepos' for details)
66 [255]
67
68 so enable it
69
70 $ cat >> $HGRCPATH <<EOF
71 > [subrepos]
72 > allowed = hg, svn
73 > EOF
74
60 $ hg ci -m1
75 $ hg ci -m1
61
76
62 make sure we avoid empty commits (issue2445)
77 make sure we avoid empty commits (issue2445)
General Comments 0
You need to be logged in to leave comments. Login now