comparison tests/test-evolve-obshistory-fold.t @ 3890:840c48296511

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