|
1 ============================================ |
|
2 Testing obsolescence markers push: Cases A.3 |
|
3 ============================================ |
|
4 |
|
5 Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of |
|
6 all changesets that requested to be "in sync" after the push (even if they are |
|
7 already on both side). |
|
8 |
|
9 This test belongs to a series of tests checking such set is properly computed |
|
10 and applied. This does not tests "obsmarkers" discovery capabilities. |
|
11 |
|
12 Category A: simple cases |
|
13 TestCase 3: old branch split in two, only one of the new one pushed |
|
14 Variants: |
|
15 # a: changesets are known on remote |
|
16 # b: changesets are known on remote (push needs -f) |
|
17 |
|
18 A.3 new branchs created, one pushed. |
|
19 ==================================== |
|
20 |
|
21 .. {{{ |
|
22 .. B' ○⇢ø B |
|
23 .. | | |
|
24 .. \Aø⇠◔ A' |
|
25 .. \|/ |
|
26 .. ● O |
|
27 .. }}} |
|
28 .. |
|
29 .. Markers exist from: |
|
30 .. |
|
31 .. * `A ø⇠○ A'` |
|
32 .. * `B ø⇠○ B'` |
|
33 .. |
|
34 .. Command runs: |
|
35 .. |
|
36 .. * hg push -r A |
|
37 .. |
|
38 .. Expected exchange: |
|
39 .. |
|
40 .. * chain from A |
|
41 .. |
|
42 .. Expected exclude: |
|
43 .. |
|
44 .. * chain from B |
|
45 .. |
|
46 .. Extra note: |
|
47 .. |
|
48 .. If A and B are remontly known, we should expect: |
|
49 .. |
|
50 .. * `hg push` will complain about the new head |
|
51 .. * `hg push` should complain about unstable history creation |
|
52 |
|
53 Setup |
|
54 ----- |
|
55 |
|
56 $ . $TESTDIR/testlib/exchange-obsmarker-util.sh |
|
57 |
|
58 initial |
|
59 |
|
60 $ setuprepos A.3.a |
|
61 creating test repo for test case A.3.a |
|
62 - pulldest |
|
63 - main |
|
64 - pushdest |
|
65 cd into `main` and proceed with env setup |
|
66 $ cd main |
|
67 $ mkcommit A0 |
|
68 $ mkcommit B0 |
|
69 $ hg update -q 0 |
|
70 $ mkcommit A1 |
|
71 created new head |
|
72 $ hg update -q 0 |
|
73 $ mkcommit B1 |
|
74 created new head |
|
75 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` |
|
76 $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'` |
|
77 $ hg log -G --hidden |
|
78 @ f6298a8ac3a4 (draft): B1 |
|
79 | |
|
80 | o e5ea8f9c7314 (draft): A1 |
|
81 |/ |
|
82 | x 6e72f0a95b5e (draft): B0 |
|
83 | | |
|
84 | x 28b51eb45704 (draft): A0 |
|
85 |/ |
|
86 o a9bdc8b26820 (public): O |
|
87 |
|
88 $ inspect_obsmarkers |
|
89 obsstore content |
|
90 ================ |
|
91 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
92 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
93 obshashtree |
|
94 =========== |
|
95 a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04 0000000000000000000000000000000000000000 |
|
96 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0000000000000000000000000000000000000000 |
|
97 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0000000000000000000000000000000000000000 |
|
98 e5ea8f9c73143125d36658e90ef70c6d2027a5b7 3bc2ee626e11a7cf8fee7a66d069271e17d5a597 |
|
99 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 91716bfd671b5a5854a47ac5d392edfdd25e431a |
|
100 obshashrange |
|
101 ============ |
|
102 rev node index size depth obshash |
|
103 3 e5ea8f9c7314 0 2 2 3bc2ee626e11 |
|
104 4 f6298a8ac3a4 0 2 2 91716bfd671b |
|
105 0 a9bdc8b26820 0 1 1 000000000000 |
|
106 3 e5ea8f9c7314 1 1 2 3bc2ee626e11 |
|
107 4 f6298a8ac3a4 1 1 2 91716bfd671b |
|
108 $ cd .. |
|
109 $ cd .. |
|
110 |
|
111 Actual Test for first version (changeset unknown in remote) |
|
112 ----------------------------------------------------------- |
|
113 |
|
114 $ dotest A.3.a A1 |
|
115 ## Running testcase A.3.a |
|
116 # testing echange of "A1" (e5ea8f9c7314) |
|
117 ## initial state |
|
118 # obstore: main |
|
119 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
120 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
121 # obstore: pushdest |
|
122 # obstore: pulldest |
|
123 ## pushing "A1" from main to pushdest |
|
124 pushing to pushdest |
|
125 searching for changes |
|
126 remote: adding changesets |
|
127 remote: adding manifests |
|
128 remote: adding file changes |
|
129 remote: added 1 changesets with 1 changes to 1 files |
|
130 remote: 1 new obsolescence markers |
|
131 ## post push state |
|
132 # obstore: main |
|
133 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
134 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
135 # obstore: pushdest |
|
136 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
137 # obstore: pulldest |
|
138 ## pulling "e5ea8f9c7314" from main into pulldest |
|
139 pulling from main |
|
140 searching for changes |
|
141 adding changesets |
|
142 adding manifests |
|
143 adding file changes |
|
144 added 1 changesets with 1 changes to 1 files |
|
145 1 new obsolescence markers |
|
146 (run 'hg update' to get a working copy) |
|
147 ## post pull state |
|
148 # obstore: main |
|
149 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
150 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
151 # obstore: pushdest |
|
152 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
153 # obstore: pulldest |
|
154 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
155 |
|
156 other variant: changeset known in remote |
|
157 ---------------------------------------- |
|
158 |
|
159 $ setuprepos A.3.b |
|
160 creating test repo for test case A.3.b |
|
161 - pulldest |
|
162 - main |
|
163 - pushdest |
|
164 cd into `main` and proceed with env setup |
|
165 $ cd main |
|
166 $ mkcommit A0 |
|
167 $ mkcommit B0 |
|
168 $ hg push -q ../pushdest |
|
169 $ hg push -q ../pulldest |
|
170 $ hg update -q 0 |
|
171 $ mkcommit A1 |
|
172 created new head |
|
173 $ hg update -q 0 |
|
174 $ mkcommit B1 |
|
175 created new head |
|
176 $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'` |
|
177 $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'` |
|
178 $ hg log -G --hidden |
|
179 @ f6298a8ac3a4 (draft): B1 |
|
180 | |
|
181 | o e5ea8f9c7314 (draft): A1 |
|
182 |/ |
|
183 | x 6e72f0a95b5e (draft): B0 |
|
184 | | |
|
185 | x 28b51eb45704 (draft): A0 |
|
186 |/ |
|
187 o a9bdc8b26820 (public): O |
|
188 |
|
189 $ inspect_obsmarkers |
|
190 obsstore content |
|
191 ================ |
|
192 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
193 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
194 obshashtree |
|
195 =========== |
|
196 a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04 0000000000000000000000000000000000000000 |
|
197 28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0000000000000000000000000000000000000000 |
|
198 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0000000000000000000000000000000000000000 |
|
199 e5ea8f9c73143125d36658e90ef70c6d2027a5b7 3bc2ee626e11a7cf8fee7a66d069271e17d5a597 |
|
200 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 91716bfd671b5a5854a47ac5d392edfdd25e431a |
|
201 obshashrange |
|
202 ============ |
|
203 rev node index size depth obshash |
|
204 3 e5ea8f9c7314 0 2 2 3bc2ee626e11 |
|
205 4 f6298a8ac3a4 0 2 2 91716bfd671b |
|
206 0 a9bdc8b26820 0 1 1 000000000000 |
|
207 3 e5ea8f9c7314 1 1 2 3bc2ee626e11 |
|
208 4 f6298a8ac3a4 1 1 2 91716bfd671b |
|
209 $ cd .. |
|
210 $ cd .. |
|
211 |
|
212 Actual Test for first version (changeset known in remote) |
|
213 ----------------------------------------------------------- |
|
214 |
|
215 check it complains about multiple heads |
|
216 |
|
217 $ cd A.3.b |
|
218 $ hg push -R main -r 'desc(A1)' pushdest |
|
219 pushing to pushdest |
|
220 searching for changes |
|
221 abort: push creates new remote head e5ea8f9c7314! |
|
222 (merge or see 'hg help push' for details about pushing new heads) |
|
223 [255] |
|
224 $ cd .. |
|
225 |
|
226 test obsmarkers exchange. |
|
227 |
|
228 $ dotest A.3.b A1 -f |
|
229 ## Running testcase A.3.b |
|
230 # testing echange of "A1" (e5ea8f9c7314) |
|
231 ## initial state |
|
232 # obstore: main |
|
233 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
234 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
235 # obstore: pushdest |
|
236 # obstore: pulldest |
|
237 ## pushing "A1" from main to pushdest |
|
238 pushing to pushdest |
|
239 searching for changes |
|
240 remote: adding changesets |
|
241 remote: adding manifests |
|
242 remote: adding file changes |
|
243 remote: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
244 remote: 1 new obsolescence markers |
|
245 ## post push state |
|
246 # obstore: main |
|
247 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
248 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
249 # obstore: pushdest |
|
250 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
251 # obstore: pulldest |
|
252 ## pulling "e5ea8f9c7314" from main into pulldest |
|
253 pulling from main |
|
254 searching for changes |
|
255 adding changesets |
|
256 adding manifests |
|
257 adding file changes |
|
258 added 1 changesets with 1 changes to 1 files (+1 heads) |
|
259 1 new obsolescence markers |
|
260 (run 'hg heads' to see heads, 'hg merge' to merge) |
|
261 1 new unstable changesets |
|
262 ## post pull state |
|
263 # obstore: main |
|
264 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
265 6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
266 # obstore: pushdest |
|
267 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
268 # obstore: pulldest |
|
269 28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |