Mercurial > evolve
comparison tests/test-evolve-obshistory-prune.t @ 3887:3eb9d9715776
tests: extract the obshistory prune test case into a separate file
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 22 May 2018 17:37:40 +0200 |
parents | tests/test-evolve-obshistory.t@8f27e17c3558 |
children | 8c368720f010 |
comparison
equal
deleted
inserted
replaced
3886:8f27e17c3558 | 3887:3eb9d9715776 |
---|---|
1 This test file test the various messages when accessing obsolete | |
2 revisions. | |
3 | |
4 Global setup | |
5 ============ | |
6 | |
7 $ . $TESTDIR/testlib/obshistory_setup.sh | |
8 | |
9 Test simple common cases | |
10 ======================== | |
11 | |
12 Test setup | |
13 ---------- | |
14 $ hg init $TESTTMP/simple | |
15 $ cd $TESTTMP/simple | |
16 | |
17 Actual test | |
18 ----------- | |
19 $ hg obslog -ap null | |
20 @ 000000000000 (-1) | |
21 | |
22 $ hg obslog 'wdir()' | |
23 abort: working directory revision cannot be specified | |
24 [255] | |
25 | |
26 Test output with pruned commit | |
27 ============================== | |
28 | |
29 Test setup | |
30 ---------- | |
31 | |
32 $ hg init $TESTTMP/local-prune | |
33 $ cd $TESTTMP/local-prune | |
34 $ mkcommit ROOT | |
35 $ mkcommit A0 # 0 | |
36 $ mkcommit B0 # 1 | |
37 $ hg log --hidden -G | |
38 @ changeset: 2:0dec01379d3b | |
39 | tag: tip | |
40 | user: test | |
41 | date: Thu Jan 01 00:00:00 1970 +0000 | |
42 | summary: B0 | |
43 | | |
44 o changeset: 1:471f378eab4c | |
45 | user: test | |
46 | date: Thu Jan 01 00:00:00 1970 +0000 | |
47 | summary: A0 | |
48 | | |
49 o changeset: 0:ea207398892e | |
50 user: test | |
51 date: Thu Jan 01 00:00:00 1970 +0000 | |
52 summary: ROOT | |
53 | |
54 $ hg prune -r 'desc(B0)' | |
55 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
56 working directory now at 471f378eab4c | |
57 1 changesets pruned | |
58 $ hg log --hidden -G | |
59 x changeset: 2:0dec01379d3b | |
60 | tag: tip | |
61 | user: test | |
62 | date: Thu Jan 01 00:00:00 1970 +0000 | |
63 | obsolete: pruned using prune | |
64 | summary: B0 | |
65 | | |
66 @ changeset: 1:471f378eab4c | |
67 | user: test | |
68 | date: Thu Jan 01 00:00:00 1970 +0000 | |
69 | summary: A0 | |
70 | | |
71 o changeset: 0:ea207398892e | |
72 user: test | |
73 date: Thu Jan 01 00:00:00 1970 +0000 | |
74 summary: ROOT | |
75 | |
76 | |
77 Actual test | |
78 ----------- | |
79 | |
80 $ hg obslog 'desc(B0)' --hidden --patch | |
81 x 0dec01379d3b (2) B0 | |
82 pruned using prune by test (Thu Jan 01 00:00:00 1970 +0000) | |
83 (No patch available, no successors) | |
84 | |
85 $ hg obslog 'desc(B0)' --hidden --no-graph -Tjson | python -m json.tool | |
86 [ | |
87 { | |
88 "markers": [ | |
89 { | |
90 "date": [ | |
91 *, (glob) | |
92 0 (glob) | |
93 ], | |
94 "operation": "prune", | |
95 "user": "test", | |
96 "verb": "pruned" | |
97 } | |
98 ], | |
99 "node": "0dec01379d3b", | |
100 "rev": 2, | |
101 "shortdescription": "B0" | |
102 } | |
103 ] | |
104 $ hg obslog 'desc(A0)' --patch | |
105 @ 471f378eab4c (1) A0 | |
106 | |
107 $ hg obslog 'desc(A0)' --no-graph -Tjson | python -m json.tool | |
108 [ | |
109 { | |
110 "markers": [], | |
111 "node": "471f378eab4c", | |
112 "rev": 1, | |
113 "shortdescription": "A0" | |
114 } | |
115 ] | |
116 $ hg up 1 | |
117 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
118 $ hg up 0dec01379d3b | |
119 abort: hidden revision '0dec01379d3b' is pruned! | |
120 (use --hidden to access hidden revisions) | |
121 [255] | |
122 $ hg up --hidden -r 'desc(B0)' | |
123 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
124 updated to hidden changeset 0dec01379d3b | |
125 (hidden revision '0dec01379d3b' is pruned) | |
126 working directory parent is obsolete! (0dec01379d3b) | |
127 (use 'hg evolve' to update to its parent successor) |