annotate tests/test-abort-checkin @ 5432:0d154bce2341

osutil: Solaris build fix
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 09 Oct 2007 08:39:37 -0700
parents 193e0f8d9a47
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2726
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
1 #!/bin/sh
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
2
4140
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
3 cat > abortcommit.py <<EOF
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
4 from mercurial import util
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
5
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
6 def hook(**args):
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
7 raise util.Abort("no commits allowed")
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
8
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
9 def reposetup(ui, repo):
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
10 repo.ui.setconfig("hooks", "pretxncommit.nocommits", hook)
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
11 EOF
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
12 abspath=`pwd`/abortcommit.py
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
13
2976
61fcd9fac434 Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2831
diff changeset
14 echo "[extensions]" >> $HGRCPATH
61fcd9fac434 Make tests append settings to $HGRCPATH instead of $HGTMP/.hgrc
Thomas Arendsen Hein <thomas@intevation.de>
parents: 2831
diff changeset
15 echo "mq=" >> $HGRCPATH
4140
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
16 echo "abortcommit = $abspath" >> $HGRCPATH
2726
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
17
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
18 hg init foo
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
19 cd foo
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
20 echo foo > foo
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
21 hg add foo
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
22
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
23 # mq may keep a reference to the repository so __del__ will not be called
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
24 # and .hg/journal.dirstate will not be deleted:
4140
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
25 hg ci -m foo
193e0f8d9a47 test-abort-checkin: use a hook to abort the commit
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2976
diff changeset
26 hg ci -m foo
2726
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
27
6bd351194a96 Add test mq keeping a reference to localrepo which can't remove journal on exit.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
28 exit 0