I do not know where your line is for simple lands, but you can make such a hook:
for subrepo in $(find $(hg root) -type d -name .hg) ; do if [ "$(hg --repository ${subrepo$$.hg} status -mard)" != "" ] ; then echo Uncommitted subrepo changes in ${subrepo%%.hg} exit 1 fi done
Save this somehow as ~/bin/dirtysubrepos , and then add it to your ~/.hgrc :
[hooks] precommit.dirtysuprepos = ~/bin/dirtysubrepos
Disclaimer: This code has never been entered anywhere other than this text field, so it almost certainly has syntax errors.
source share