comparison tests/test-evolve-obshistory-amend-then-fold.t @ 3892:106c871dfebc

tests: extract the obshistory amend then fold test case into a separate file
author Boris Feld <boris.feld@octobus.net>
date Tue, 22 May 2018 17:44:05 +0200
parents tests/test-evolve-obshistory.t@11b775fddda8
children f7afd3a158e3 f16274729530
comparison
equal deleted inserted replaced
3891:11b775fddda8 3892:106c871dfebc
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 output with amended + folded commit
10 ========================================
11
12 Test setup
13 ----------
14
15 $ hg init $TESTTMP/local-amend-fold
16 $ cd $TESTTMP/local-amend-fold
17 $ mkcommit ROOT
18 $ mkcommit A0
19 $ mkcommit B0
20 $ hg amend -m "B1"
21 $ hg log --hidden -G
22 @ changeset: 3:b7ea6d14e664
23 | tag: tip
24 | parent: 1:471f378eab4c
25 | user: test
26 | date: Thu Jan 01 00:00:00 1970 +0000
27 | summary: B1
28 |
29 | x changeset: 2:0dec01379d3b
30 |/ user: test
31 | date: Thu Jan 01 00:00:00 1970 +0000
32 | obsolete: reworded using amend as 3:b7ea6d14e664
33 | summary: B0
34 |
35 o changeset: 1:471f378eab4c
36 | user: test
37 | date: Thu Jan 01 00:00:00 1970 +0000
38 | summary: A0
39 |
40 o changeset: 0:ea207398892e
41 user: test
42 date: Thu Jan 01 00:00:00 1970 +0000
43 summary: ROOT
44
45 $ hg fold --exact -r 'desc(A0) + desc(B1)' --date "0 0" -m "C0"
46 2 changesets folded
47 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ hg log --hidden -G
49 @ changeset: 4:eb5a0daa2192
50 | tag: tip
51 | parent: 0:ea207398892e
52 | user: test
53 | date: Thu Jan 01 00:00:00 1970 +0000
54 | summary: C0
55 |
56 | x changeset: 3:b7ea6d14e664
57 | | parent: 1:471f378eab4c
58 | | user: test
59 | | date: Thu Jan 01 00:00:00 1970 +0000
60 | | obsolete: rewritten using fold as 4:eb5a0daa2192
61 | | summary: B1
62 | |
63 | | x changeset: 2:0dec01379d3b
64 | |/ user: test
65 | | date: Thu Jan 01 00:00:00 1970 +0000
66 | | obsolete: reworded using amend as 3:b7ea6d14e664
67 | | summary: B0
68 | |
69 | x changeset: 1:471f378eab4c
70 |/ user: test
71 | date: Thu Jan 01 00:00:00 1970 +0000
72 | obsolete: rewritten using fold as 4:eb5a0daa2192
73 | summary: A0
74 |
75 o changeset: 0:ea207398892e
76 user: test
77 date: Thu Jan 01 00:00:00 1970 +0000
78 summary: ROOT
79
80 Actual test
81 -----------
82
83 Check that debugobshistory on head show a coherent graph
84 $ hg obslog eb5a0daa2192 --patch
85 @ eb5a0daa2192 (4) C0
86 |\
87 x | 471f378eab4c (1) A0
88 / rewritten(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
89 | diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
90 | --- a/changeset-description
91 | +++ b/changeset-description
92 | @@ -1,1 +1,1 @@
93 | -A0
94 | +C0
95 |
96 | diff -r 471f378eab4c -r eb5a0daa2192 B0
97 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
98 | +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
99 | @@ -0,0 +1,1 @@
100 | +B0
101 |
102 |
103 x b7ea6d14e664 (3) B1
104 | rewritten(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
105 | (No patch available, changesets rebased)
106 |
107 x 0dec01379d3b (2) B0
108 rewritten(description) as b7ea6d14e664 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
109 diff -r 0dec01379d3b -r b7ea6d14e664 changeset-description
110 --- a/changeset-description
111 +++ b/changeset-description
112 @@ -1,1 +1,1 @@
113 -B0
114 +B1
115
116
117 Check that obslog on ROOT with all option show everything
118 $ hg obslog 1 --hidden --all --patch
119 @ eb5a0daa2192 (4) C0
120 |\
121 x | 471f378eab4c (1) A0
122 / rewritten(description, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
123 | diff -r 471f378eab4c -r eb5a0daa2192 changeset-description
124 | --- a/changeset-description
125 | +++ b/changeset-description
126 | @@ -1,1 +1,1 @@
127 | -A0
128 | +C0
129 |
130 | diff -r 471f378eab4c -r eb5a0daa2192 B0
131 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
132 | +++ b/B0 Thu Jan 01 00:00:00 1970 +0000
133 | @@ -0,0 +1,1 @@
134 | +B0
135 |
136 |
137 x b7ea6d14e664 (3) B1
138 | rewritten(description, parent, content) as eb5a0daa2192 using fold by test (Thu Jan 01 00:00:00 1970 +0000)
139 | (No patch available, changesets rebased)
140 |
141 x 0dec01379d3b (2) B0
142 rewritten(description) as b7ea6d14e664 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
143 diff -r 0dec01379d3b -r b7ea6d14e664 changeset-description
144 --- a/changeset-description
145 +++ b/changeset-description
146 @@ -1,1 +1,1 @@
147 -B0
148 +B1
149
150
151 $ hg obslog eb5a0daa2192 --no-graph -Tjson | python -m json.tool
152 [
153 {
154 "markers": [],
155 "node": "eb5a0daa2192",
156 "rev": 4,
157 "shortdescription": "C0"
158 },
159 {
160 "markers": [
161 {
162 "date": [
163 *, (glob)
164 0 (glob)
165 ],
166 "effect": [
167 *, (glob)
168 *, (glob)
169 "content"
170 ],
171 "operation": "fold",
172 "succnodes": [
173 "eb5a0daa2192"
174 ],
175 "user": "test",
176 "verb": "rewritten"
177 }
178 ],
179 "node": "b7ea6d14e664",
180 "rev": 3,
181 "shortdescription": "B1"
182 },
183 {
184 "markers": [
185 {
186 "date": [
187 *, (glob)
188 0 (glob)
189 ],
190 "effect": [
191 "description"
192 ],
193 "operation": "amend",
194 "succnodes": [
195 "b7ea6d14e664"
196 ],
197 "user": "test",
198 "verb": "rewritten"
199 }
200 ],
201 "node": "0dec01379d3b",
202 "rev": 2,
203 "shortdescription": "B0"
204 },
205 {
206 "markers": [
207 {
208 "date": [
209 *, (glob)
210 0 (glob)
211 ],
212 "effect": [
213 "description",
214 "content"
215 ],
216 "operation": "fold",
217 "succnodes": [
218 "eb5a0daa2192"
219 ],
220 "user": "test",
221 "verb": "rewritten"
222 }
223 ],
224 "node": "471f378eab4c",
225 "rev": 1,
226 "shortdescription": "A0"
227 }
228 ]
229 $ hg update 471f378eab4c
230 abort: hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192!
231 (use --hidden to access hidden revisions)
232 [255]
233 $ hg update --hidden 'desc(A0)'
234 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
235 updated to hidden changeset 471f378eab4c
236 (hidden revision '471f378eab4c' was rewritten as: eb5a0daa2192)
237 working directory parent is obsolete! (471f378eab4c)
238 (use 'hg evolve' to update to its successor: eb5a0daa2192)
239 $ hg update --hidden 0dec01379d3b
240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 updated to hidden changeset 0dec01379d3b
242 (hidden revision '0dec01379d3b' was rewritten as: eb5a0daa2192)
243 working directory parent is obsolete! (0dec01379d3b)
244 (use 'hg evolve' to update to its successor: eb5a0daa2192)
245 $ hg update 0dec01379d3b
246 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
247 $ hg update --hidden 'desc(B0)'
248 0 files updated, 0 files merged, 0 files removed, 0 files unresolved