Show More
@@ -1,37 +1,37 | |||||
1 | $ cat > abortcommit.py <<EOF |
|
1 | $ cat > abortcommit.py <<EOF | |
2 | > from mercurial import error |
|
2 | > from mercurial import error | |
3 | > def hook(**args): |
|
3 | > def hook(**args): | |
4 | > raise error.Abort("no commits allowed") |
|
4 | > raise error.Abort(b"no commits allowed") | |
5 | > def reposetup(ui, repo): |
|
5 | > def reposetup(ui, repo): | |
6 | > repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook) |
|
6 | > repo.ui.setconfig(b"hooks", b"pretxncommit.nocommits", hook) | |
7 | > EOF |
|
7 | > EOF | |
8 | $ abspath=`pwd`/abortcommit.py |
|
8 | $ abspath=`pwd`/abortcommit.py | |
9 |
|
9 | |||
10 | $ cat <<EOF >> $HGRCPATH |
|
10 | $ cat <<EOF >> $HGRCPATH | |
11 | > [extensions] |
|
11 | > [extensions] | |
12 | > mq = |
|
12 | > mq = | |
13 | > abortcommit = $abspath |
|
13 | > abortcommit = $abspath | |
14 | > EOF |
|
14 | > EOF | |
15 |
|
15 | |||
16 | $ hg init foo |
|
16 | $ hg init foo | |
17 | $ cd foo |
|
17 | $ cd foo | |
18 | $ echo foo > foo |
|
18 | $ echo foo > foo | |
19 | $ hg add foo |
|
19 | $ hg add foo | |
20 |
|
20 | |||
21 | mq may keep a reference to the repository so __del__ will not be |
|
21 | mq may keep a reference to the repository so __del__ will not be | |
22 | called and .hg/journal.dirstate will not be deleted: |
|
22 | called and .hg/journal.dirstate will not be deleted: | |
23 |
|
23 | |||
24 | $ hg ci -m foo |
|
24 | $ hg ci -m foo | |
25 | error: pretxncommit.nocommits hook failed: no commits allowed |
|
25 | error: pretxncommit.nocommits hook failed: no commits allowed | |
26 | transaction abort! |
|
26 | transaction abort! | |
27 | rollback completed |
|
27 | rollback completed | |
28 | abort: no commits allowed |
|
28 | abort: no commits allowed | |
29 | [255] |
|
29 | [255] | |
30 | $ hg ci -m foo |
|
30 | $ hg ci -m foo | |
31 | error: pretxncommit.nocommits hook failed: no commits allowed |
|
31 | error: pretxncommit.nocommits hook failed: no commits allowed | |
32 | transaction abort! |
|
32 | transaction abort! | |
33 | rollback completed |
|
33 | rollback completed | |
34 | abort: no commits allowed |
|
34 | abort: no commits allowed | |
35 | [255] |
|
35 | [255] | |
36 |
|
36 | |||
37 | $ cd .. |
|
37 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now