Debian Codegraph @

tests/test-close-head.t

raw
1 $ hg init test-content
2 $ cd test-content
3 $ hg debugbuilddag '+2*2*3*4+7'
4 $ hg bookmark -r 1 @
5 $ hg log -G --template '{rev}:{node|short}'
6 o 11:1d876b1f862c
7 |
8 o 10:ea5f71948eb8
9 |
10 o 9:f1b0356d867a
11 |
12 o 8:e8d1253fb0d7
13 |
14 o 7:d423bbba4459
15 |
16 o 6:a2f58e9c1e56
17 |
18 o 5:3a367db1fabc
19 |
20 o 4:e7bd5218ca15
21 |
22 | o 3:6100d3090acf
23 |/
24 | o 2:fa942426a6fd
25 |/
26 | o 1:66f7d451a68b
27 |/
28 o 0:1ea73414a91b
29
30 $ hg --config extensions.closehead= close-head -m 'Not a head' 0 1
31 abort: revision is not an open head: 0
32 [255]
33 $ hg --config extensions.closehead= close-head -m 'Not a head' -r 0 1
34 abort: revision is not an open head: 0
35 [255]
36 $ hg id
37 000000000000
38 $ hg --config extensions.closehead= close-head -m 'Close old heads' -r 1 2
39 $ hg id
40 000000000000
41 $ hg bookmark
42 @ 1:66f7d451a68b
43 $ hg heads
44 changeset: 11:1d876b1f862c
45 user: debugbuilddag
46 date: Thu Jan 01 00:00:11 1970 +0000
47 summary: r11
48
49 changeset: 3:6100d3090acf
50 parent: 0:1ea73414a91b
51 user: debugbuilddag
52 date: Thu Jan 01 00:00:03 1970 +0000
53 summary: r3
54
55 $ hg --config extensions.closehead= close-head -m 'Close more old heads' -r 11
56 $ hg heads
57 changeset: 3:6100d3090acf
58 parent: 0:1ea73414a91b
59 user: debugbuilddag
60 date: Thu Jan 01 00:00:03 1970 +0000
61 summary: r3
62
63 $ hg --config extensions.closehead= close-head -m 'Not a head' 0
64 abort: revision is not an open head: 0
65 [255]
66 $ hg --config extensions.closehead= close-head -m 'Already closed head' 1
67 abort: revision is not an open head: 1
68 [255]
69
70 $ hg init ../test-empty
71 $ cd ../test-empty
72 $ hg debugbuilddag '+1'
73 $ hg log -G --template '{rev}:{node|short}'
74 o 0:1ea73414a91b
75
76 $ hg --config extensions.closehead= close-head -m 'Close initial revision' 0
77 $ hg heads
78 [1]