Mercurial > hg
comparison tests/test-close-head.t @ 39993:cd5f2e615262
extensions: new closehead module for closing arbitrary heads
``hg close-head`` allows closing arbitrary heads. It is equivalent to
checking out the given revisions and commit an empty change with
``hg commit --close-branch``.
Differential Revision: https://phab.mercurial-scm.org/D3557
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Mon, 14 May 2018 00:43:07 +0200 |
parents | |
children | 12a72729678e |
comparison
equal
deleted
inserted
replaced
39992:ec3c06a1c554 | 39993:cd5f2e615262 |
---|---|
1 $ hg init test-content | |
2 $ cd test-content | |
3 $ hg debugbuilddag '+2*2*3*4' | |
4 $ hg bookmark -r 1 @ | |
5 $ hg log -G --template '{rev}:{node|short}' | |
6 o 4:e7bd5218ca15 | |
7 | | |
8 | o 3:6100d3090acf | |
9 |/ | |
10 | o 2:fa942426a6fd | |
11 |/ | |
12 | o 1:66f7d451a68b | |
13 |/ | |
14 o 0:1ea73414a91b | |
15 | |
16 $ hg --config extensions.closehead= close-head -m 'Not a head' 0 1 | |
17 abort: revision is not an open head: 0 | |
18 [255] | |
19 $ hg --config extensions.closehead= close-head -m 'Not a head' -r 0 1 | |
20 abort: revision is not an open head: 0 | |
21 [255] | |
22 $ hg --config extensions.closehead= close-head -m 'Close old heads' -r 1 2 | |
23 $ hg bookmark | |
24 @ 1:66f7d451a68b | |
25 $ hg heads | |
26 changeset: 4:e7bd5218ca15 | |
27 parent: 0:1ea73414a91b | |
28 user: debugbuilddag | |
29 date: Thu Jan 01 00:00:04 1970 +0000 | |
30 summary: r4 | |
31 | |
32 changeset: 3:6100d3090acf | |
33 parent: 0:1ea73414a91b | |
34 user: debugbuilddag | |
35 date: Thu Jan 01 00:00:03 1970 +0000 | |
36 summary: r3 | |
37 | |
38 $ hg --config extensions.closehead= close-head -m 'Close more old heads' 4 | |
39 $ hg heads | |
40 changeset: 3:6100d3090acf | |
41 parent: 0:1ea73414a91b | |
42 user: debugbuilddag | |
43 date: Thu Jan 01 00:00:03 1970 +0000 | |
44 summary: r3 | |
45 | |
46 $ hg --config extensions.closehead= close-head -m 'Not a head' 0 | |
47 abort: revision is not an open head: 0 | |
48 [255] | |
49 $ hg --config extensions.closehead= close-head -m 'Already closed head' 1 | |
50 abort: revision is not an open head: 1 | |
51 [255] | |
52 | |
53 $ hg init ../test-empty | |
54 $ cd ../test-empty | |
55 $ hg debugbuilddag '+1' | |
56 $ hg log -G --template '{rev}:{node|short}' | |
57 o 0:1ea73414a91b | |
58 | |
59 $ hg --config extensions.closehead= close-head -m 'Close initial revision' 0 | |
60 $ hg heads | |
61 [1] |