2006-07-28 10:59:06 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-03-04 20:35:11 +03:00
|
|
|
cat > abortcommit.py <<EOF
|
|
|
|
from mercurial import util
|
|
|
|
|
|
|
|
def hook(**args):
|
|
|
|
raise util.Abort("no commits allowed")
|
|
|
|
|
|
|
|
def reposetup(ui, repo):
|
|
|
|
repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook)
|
|
|
|
EOF
|
|
|
|
abspath=`pwd`/abortcommit.py
|
|
|
|
|
2006-08-22 12:08:42 +04:00
|
|
|
echo "[extensions]" >> $HGRCPATH
|
|
|
|
echo "mq=" >> $HGRCPATH
|
2007-03-04 20:35:11 +03:00
|
|
|
echo "abortcommit = $abspath" >> $HGRCPATH
|
2006-07-28 10:59:06 +04:00
|
|
|
|
|
|
|
hg init foo
|
|
|
|
cd foo
|
|
|
|
echo foo > foo
|
|
|
|
hg add foo
|
|
|
|
|
|
|
|
# mq may keep a reference to the repository so __del__ will not be called
|
|
|
|
# and .hg/journal.dirstate will not be deleted:
|
2007-03-04 20:35:11 +03:00
|
|
|
hg ci -m foo
|
|
|
|
hg ci -m foo
|
2006-07-28 10:59:06 +04:00
|
|
|
|
|
|
|
exit 0
|