##// END OF EJS Templates
subrepo: refuse to commit subrepos if .hgsub is excluded (issue2232)
Matt Mackall -
r11485:b602a95c stable
parent child Browse files
Show More
@@ -826,7 +826,12 b' class localrepository(repo.repository):'
826 removedsubs.discard(s)
826 removedsubs.discard(s)
827 if match(s) and wctx.sub(s).dirty():
827 if match(s) and wctx.sub(s).dirty():
828 subs.append(s)
828 subs.append(s)
829 if (subs or removedsubs) and '.hgsubstate' not in changes[0]:
829 if (subs or removedsubs):
830 # is hgsub modified and not included?
831 if (not match('.hgsub') and
832 '.hgsub' in (wctx.modified() + wctx.added())):
833 raise util.Abort("can't commit subrepos without .hgsub")
834 if '.hgsubstate' not in changes[0]:
830 changes[0].insert(0, '.hgsubstate')
835 changes[0].insert(0, '.hgsubstate')
831
836
832 # make sure all explicit patterns are matched
837 # make sure all explicit patterns are matched
@@ -15,12 +15,15 b' echo s = s > .hgsub'
15 hg add .hgsub
15 hg add .hgsub
16 hg init s
16 hg init s
17 echo a > s/a
17 echo a > s/a
18
19 # issue2232 - committing a subrepo without .hgsub
20 hg ci -mbad s
21
18 hg -R s ci -Ams0
22 hg -R s ci -Ams0
19 hg sum
23 hg sum
20 hg ci -m1
24 hg ci -m1
21
25
22 # issue 2022 - update -C
26 # issue 2022 - update -C
23
24 echo b > s/a
27 echo b > s/a
25 hg sum
28 hg sum
26 hg co -C 1
29 hg co -C 1
@@ -1,6 +1,7 b''
1 % first revision, no sub
1 % first revision, no sub
2 adding a
2 adding a
3 % add first sub
3 % add first sub
4 abort: can't commit subrepos without .hgsub
4 adding a
5 adding a
5 parent: 0:f7b1eb17ad24 tip
6 parent: 0:f7b1eb17ad24 tip
6 0
7 0
General Comments 0
You need to be logged in to leave comments. Login now