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