Mercurial > hg > mercurial-crew-with-dirclash
annotate tests/test-copy2 @ 2734:07026da25ed8
hbisect.py: don't rely on __del__ to write the current state.
This is yet another page of the "Thou shalt not do too much inside
__del__ methods" book, in the "demandload and __del__ don't go well
together" chapter.
The bisect extension is broken in 0.9.1:
$ hg bisect init
$ hg bisect bad
Fatal Python error: Interpreter not initialized (version mismatch?)
Aborted
(yes, I tripled checked my instalation to make sure the problem is not
there)
It's been broken since revision fe1689273f84 moved the import of the
binascii module into a demandload.
(In details: the first time that "hg bisect bad" (or good) is called,
there are still no revisions saved in .hg/bisect/*, so bisect.__init__
doesn't call hg.bin on anything. So, when we reach __del__, the
binascii module still hasn't been imported and we get that "nice"
message above.)
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Fri, 28 Jul 2006 21:20:41 -0300 |
parents | 94f38724283f |
children | c0b449154a90 |
rev | line source |
---|---|
1117 | 1 #!/bin/sh |
2 | |
3 hg init | |
4 echo foo > foo | |
5 hg add foo | |
6 hg commit -m1 -d"0 0" | |
7 | |
8 echo "# should show copy" | |
9 hg copy foo bar | |
1168
235e0effa672
Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1127
diff
changeset
|
10 hg debugstate|grep '^copy' |
1117 | 11 |
12 echo "# shouldn't show copy" | |
13 hg commit -m2 -d"0 0" | |
1168
235e0effa672
Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1127
diff
changeset
|
14 hg debugstate|grep '^copy' |
1117 | 15 |
16 echo "# should match" | |
17 hg debugindex .hg/data/foo.i | |
18 hg debugrename bar | |
19 | |
20 echo bleah > foo | |
21 echo quux > bar | |
22 hg commit -m3 -d"0 0" | |
23 | |
24 echo "# should not be renamed" | |
25 hg debugrename bar | |
26 | |
1249
a5355fa5e33a
Fix up copy command to behave more like regular "cp".
Bryan O'Sullivan <bos@serpentine.com>
parents:
1168
diff
changeset
|
27 hg copy -f foo bar |
1117 | 28 echo "# should show copy" |
1168
235e0effa672
Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1127
diff
changeset
|
29 hg debugstate|grep '^copy' |
1117 | 30 hg commit -m3 -d"0 0" |
31 | |
32 echo "# should show no parents for tip" | |
33 hg debugindex .hg/data/bar.i | |
34 echo "# should match" | |
35 hg debugindex .hg/data/foo.i | |
36 hg debugrename bar | |
37 | |
38 echo "# should show no copies" | |
1168
235e0effa672
Fixed two tests to run with bourne shell.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1127
diff
changeset
|
39 hg debugstate|grep '^copy' |
1127
19b048da4da9
Fixed test-copy2 with only looking at copied files.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1117
diff
changeset
|
40 |
19b048da4da9
Fixed test-copy2 with only looking at copied files.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1117
diff
changeset
|
41 exit 0 |