##// 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 826 removedsubs.discard(s)
827 827 if match(s) and wctx.sub(s).dirty():
828 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 835 changes[0].insert(0, '.hgsubstate')
831 836
832 837 # make sure all explicit patterns are matched
@@ -15,12 +15,15 b' echo s = s > .hgsub'
15 15 hg add .hgsub
16 16 hg init s
17 17 echo a > s/a
18
19 # issue2232 - committing a subrepo without .hgsub
20 hg ci -mbad s
21
18 22 hg -R s ci -Ams0
19 23 hg sum
20 24 hg ci -m1
21 25
22 26 # issue 2022 - update -C
23
24 27 echo b > s/a
25 28 hg sum
26 29 hg co -C 1
@@ -1,6 +1,7 b''
1 1 % first revision, no sub
2 2 adding a
3 3 % add first sub
4 abort: can't commit subrepos without .hgsub
4 5 adding a
5 6 parent: 0:f7b1eb17ad24 tip
6 7 0
General Comments 0
You need to be logged in to leave comments. Login now