comparison mercurial/localrepo.py @ 11485:b602a95c21ec stable

subrepo: refuse to commit subrepos if .hgsub is excluded (issue2232)
author Matt Mackall <mpm@selenic.com>
date Thu, 01 Jul 2010 11:20:13 -0500
parents ee1ed6afac21
children d3c3e2fdeb0c
comparison
equal deleted inserted replaced
11484:44b4873ea59b 11485:b602a95c21ec
824 removedsubs.update(s for s in p.substate if match(s)) 824 removedsubs.update(s for s in p.substate if match(s))
825 for s in wctx.substate: 825 for s in wctx.substate:
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 changes[0].insert(0, '.hgsubstate') 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]:
835 changes[0].insert(0, '.hgsubstate')
831 836
832 # make sure all explicit patterns are matched 837 # make sure all explicit patterns are matched
833 if not force and match.files(): 838 if not force and match.files():
834 matched = set(changes[0] + changes[1] + changes[2]) 839 matched = set(changes[0] + changes[1] + changes[2])
835 840