comparison tests/test-evolve-obshistory.t @ 3888:4e434eb1a506

tests: extract the obshistory split test case into a separate file
author Boris Feld <boris.feld@octobus.net>
date Tue, 22 May 2018 17:37:51 +0200
parents 3eb9d9715776
children 8ed81c330e82
comparison
equal deleted inserted replaced
3887:3eb9d9715776 3888:4e434eb1a506
20 @ 000000000000 (-1) 20 @ 000000000000 (-1)
21 21
22 $ hg obslog 'wdir()' 22 $ hg obslog 'wdir()'
23 abort: working directory revision cannot be specified 23 abort: working directory revision cannot be specified
24 [255] 24 [255]
25
26 Test output with splitted commit
27 ================================
28
29 Test setup
30 ----------
31
32 $ hg init $TESTTMP/local-split
33 $ cd $TESTTMP/local-split
34 $ mkcommit ROOT
35 $ echo 42 >> a
36 $ echo 43 >> b
37 $ hg commit -A -m "A0"
38 adding a
39 adding b
40 $ hg log --hidden -G
41 @ changeset: 1:471597cad322
42 | tag: tip
43 | user: test
44 | date: Thu Jan 01 00:00:00 1970 +0000
45 | summary: A0
46 |
47 o changeset: 0:ea207398892e
48 user: test
49 date: Thu Jan 01 00:00:00 1970 +0000
50 summary: ROOT
51
52 $ hg split -r 'desc(A0)' -n "testing split" -d "0 0" << EOF
53 > y
54 > y
55 > n
56 > n
57 > y
58 > y
59 > EOF
60 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
61 adding a
62 adding b
63 diff --git a/a b/a
64 new file mode 100644
65 examine changes to 'a'? [Ynesfdaq?] y
66
67 @@ -0,0 +1,1 @@
68 +42
69 record change 1/2 to 'a'? [Ynesfdaq?] y
70
71 diff --git a/b b/b
72 new file mode 100644
73 examine changes to 'b'? [Ynesfdaq?] n
74
75 created new head
76 Done splitting? [yN] n
77 diff --git a/b b/b
78 new file mode 100644
79 examine changes to 'b'? [Ynesfdaq?] y
80
81 @@ -0,0 +1,1 @@
82 +43
83 record this change to 'b'? [Ynesfdaq?] y
84
85 no more change to split
86
87 $ hg log --hidden -G
88 @ changeset: 3:f257fde29c7a
89 | tag: tip
90 | user: test
91 | date: Thu Jan 01 00:00:00 1970 +0000
92 | summary: A0
93 |
94 o changeset: 2:337fec4d2edc
95 | parent: 0:ea207398892e
96 | user: test
97 | date: Thu Jan 01 00:00:00 1970 +0000
98 | summary: A0
99 |
100 | x changeset: 1:471597cad322
101 |/ user: test
102 | date: Thu Jan 01 00:00:00 1970 +0000
103 | obsolete: split using split as 2:337fec4d2edc, 3:f257fde29c7a
104 | summary: A0
105 |
106 o changeset: 0:ea207398892e
107 user: test
108 date: Thu Jan 01 00:00:00 1970 +0000
109 summary: ROOT
110
111 Actual test
112 -----------
113
114 Check that debugobshistory on splitted commit show both targets
115 $ hg obslog 471597cad322 --hidden --patch
116 x 471597cad322 (1) A0
117 rewritten(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
118 note: testing split
119 (No patch available, too many successors (2))
120
121 $ hg obslog 471597cad322 --hidden --no-graph -Tjson | python -m json.tool
122 [
123 {
124 "markers": [
125 {
126 "date": [
127 *, (glob)
128 0 (glob)
129 ],
130 "effect": [
131 "parent",
132 "content"
133 ],
134 "note": "testing split",
135 "operation": "split",
136 "succnodes": [
137 "337fec4d2edc",
138 "f257fde29c7a"
139 ],
140 "user": "test",
141 "verb": "rewritten"
142 }
143 ],
144 "node": "471597cad322",
145 "rev": 1,
146 "shortdescription": "A0"
147 }
148 ]
149 Check that debugobshistory on the first successor after split show
150 the revision plus the splitted one
151 $ hg obslog 337fec4d2edc --patch
152 o 337fec4d2edc (2) A0
153 |
154 x 471597cad322 (1) A0
155 rewritten(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
156 note: testing split
157 (No patch available, too many successors (2))
158
159 With the all option, it should show the three changesets
160 $ hg obslog --all 337fec4d2edc --patch
161 o 337fec4d2edc (2) A0
162 |
163 | @ f257fde29c7a (3) A0
164 |/
165 x 471597cad322 (1) A0
166 rewritten(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
167 note: testing split
168 (No patch available, too many successors (2))
169
170 Check that debugobshistory on the second successor after split show
171 the revision plus the splitted one
172 $ hg obslog f257fde29c7a --patch
173 @ f257fde29c7a (3) A0
174 |
175 x 471597cad322 (1) A0
176 rewritten(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
177 note: testing split
178 (No patch available, too many successors (2))
179
180 With the all option, it should show the three changesets
181 $ hg obslog f257fde29c7a --all --patch
182 o 337fec4d2edc (2) A0
183 |
184 | @ f257fde29c7a (3) A0
185 |/
186 x 471597cad322 (1) A0
187 rewritten(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
188 note: testing split
189 (No patch available, too many successors (2))
190
191 Obslog with all option all should also works on the splitted commit
192 $ hg obslog -a 471597cad322 --hidden --patch
193 o 337fec4d2edc (2) A0
194 |
195 | @ f257fde29c7a (3) A0
196 |/
197 x 471597cad322 (1) A0
198 rewritten(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
199 note: testing split
200 (No patch available, too many successors (2))
201
202 Check that debugobshistory on both successors after split show
203 a coherent graph
204 $ hg obslog 'f257fde29c7a+337fec4d2edc' --patch
205 o 337fec4d2edc (2) A0
206 |
207 | @ f257fde29c7a (3) A0
208 |/
209 x 471597cad322 (1) A0
210 rewritten(parent, content) as 337fec4d2edc, f257fde29c7a using split by test (Thu Jan 01 00:00:00 1970 +0000)
211 note: testing split
212 (No patch available, too many successors (2))
213
214 $ hg update 471597cad322
215 abort: hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a!
216 (use --hidden to access hidden revisions)
217 [255]
218 $ hg update --hidden 'min(desc(A0))'
219 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 updated to hidden changeset 471597cad322
221 (hidden revision '471597cad322' was split as: 337fec4d2edc, f257fde29c7a)
222 working directory parent is obsolete! (471597cad322)
223 (use 'hg evolve' to update to its tipmost successor: 337fec4d2edc, f257fde29c7a)
224 25
225 Test output with lots of splitted commit 26 Test output with lots of splitted commit
226 ======================================== 27 ========================================
227 28
228 Test setup 29 Test setup