comparison tests/test-exchange-A1.t @ 827:f62ff54c893b

exchange: add test case for A.1 Testcase defined here: http://mercurial.selenic.com/wiki/ObsolescenceMarkersExchange
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 28 Feb 2014 16:21:22 -0800
parents
children 0943f327e2fb
comparison
equal deleted inserted replaced
826:bee5e1105e6c 827:f62ff54c893b
1
2 Initial setup
3
4 $ cat >> $HGRCPATH <<EOF
5 > [web]
6 > push_ssl = false
7 > allow_push = *
8 > [ui]
9 > logtemplate ="{node|short} ({phase}): {desc}\n"
10 > [phases]
11 > publish=False
12 > [extensions]
13 > hgext.rebase=
14 > EOF
15 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
16
17 $ mkcommit() {
18 > echo "$1" > "$1"
19 > hg add "$1"
20 > hg ci -m "$1"
21 > }
22 $ getid() {
23 > hg id --hidden --debug -ir "$1"
24 > }
25
26 ==== A.1.1 pushing a single head ====
27 ..
28 .. {{{
29 .. ⇠◔ A
30 .. |
31 .. ● O
32 .. }}}
33 ..
34 .. Marker exist from:
35 ..
36 .. * A
37 ..
38 .. Command run:
39 ..
40 .. * hg push -r A
41 .. * hg push
42 ..
43 .. Expected exchange:
44 ..
45 .. * chain from A
46
47 Setup
48 ---------------
49
50 initial
51
52 $ mkdir A.1.1
53 $ cd A.1.1
54 $ hg init source
55 $ hg init dest
56 $ hg init other
57 $ cd source
58 $ mkcommit O
59 $ hg phase --public .
60 $ hg push -q ../dest
61 $ hg push -q ../other
62 $ mkcommit A
63 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A)'`
64 $ hg log -G
65 @ f5bc6836db60 (draft): A
66 |
67 o a9bdc8b26820 (public): O
68
69 $ hg debugobsolete
70 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
71 $ cd ..
72 $ cd ..
73
74 setup both variants
75
76 $ cp -r A.1.1 A.1.1.a
77 $ cp -r A.1.1 A.1.1.b
78
79
80 Variante a: push -r A
81 ---------------------
82
83 $ cd A.1.1.a
84 $ hg -R source id -r 'desc(A)'
85 f5bc6836db60 tip
86 $ hg -R source debugobsolete
87 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
88 $ hg -R dest debugobsolete
89 $ hg -R other debugobsolete
90
91 $ hg -R source push -r 'desc(A)' dest
92 pushing to dest
93 searching for changes
94 adding changesets
95 adding manifests
96 adding file changes
97 added 1 changesets with 1 changes to 1 files
98 OBSEXC: computing relevant nodes
99 OBSEXC: computing markers relevant to 2 nodes
100 OBSEXC: encoding 1 markers
101 OBSEXC: sending 1 pushkey payload (78 bytes)
102 OBSEXC: DONE
103 $ hg -R source debugobsolete
104 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
105 $ hg -R dest debugobsolete
106 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
107 $ hg -R other debugobsolete
108
109 $ hg -R other pull -r 'f5bc6836db60' dest
110 pulling from dest
111 searching for changes
112 adding changesets
113 adding manifests
114 adding file changes
115 added 1 changesets with 1 changes to 1 files
116 OBSEXC: pull obsolescence markers
117 OBSEXC: merging obsolescence markers (62 bytes)
118 OBSEXC: 1 markers added
119 OBSEXC: DONE
120 (run 'hg update' to get a working copy)
121 $ hg -R source debugobsolete
122 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
123 $ hg -R dest debugobsolete
124 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
125 $ hg -R other debugobsolete
126 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
127
128 $ cd ..
129
130 Variante b: push
131 ---------------------
132
133 $ cd A.1.1.b
134 $ hg -R source id -r 'desc(A)'
135 f5bc6836db60 tip
136 $ hg -R source debugobsolete
137 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
138 $ hg -R dest debugobsolete
139 $ hg -R other debugobsolete
140
141 $ hg -R source push dest
142 pushing to dest
143 searching for changes
144 adding changesets
145 adding manifests
146 adding file changes
147 added 1 changesets with 1 changes to 1 files
148 OBSEXC: computing relevant nodes
149 OBSEXC: computing markers relevant to 2 nodes
150 OBSEXC: encoding 1 markers
151 OBSEXC: sending 1 pushkey payload (78 bytes)
152 OBSEXC: DONE
153 $ hg -R source debugobsolete
154 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
155 $ hg -R dest debugobsolete
156 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
157 $ hg -R other debugobsolete
158
159 $ hg -R other pull dest
160 pulling from dest
161 searching for changes
162 adding changesets
163 adding manifests
164 adding file changes
165 added 1 changesets with 1 changes to 1 files
166 OBSEXC: pull obsolescence markers
167 OBSEXC: merging obsolescence markers (62 bytes)
168 OBSEXC: 1 markers added
169 OBSEXC: DONE
170 (run 'hg update' to get a working copy)
171 $ hg -R source debugobsolete
172 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
173 $ hg -R dest debugobsolete
174 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
175 $ hg -R other debugobsolete
176 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
177
178 $ cd ..
179
180
181
182 ==== A.1.2 pushing a multiple changeset into a single head ====
183
184 .. {{{
185 .. ◔ B
186 .. |
187 .. ⇠◔ A
188 .. |
189 .. ● O
190 .. }}}
191 ..
192 .. Marker exist from:
193 ..
194 .. * A
195 ..
196 .. Command run:
197 ..
198 .. * hg push -r B
199 .. * hg push
200 ..
201 .. Expected exchange:
202 ..
203 .. * chain from A
204
205 Setup
206 ---------------
207
208 initial
209
210 $ mkdir A.1.2
211 $ cd A.1.2
212 $ hg init source
213 $ hg init dest
214 $ hg init other
215 $ cd source
216 $ mkcommit O
217 $ hg phase --public .
218 $ hg push -q ../dest
219 $ hg push -q ../other
220 $ mkcommit A
221 $ mkcommit B
222 $ hg log -G
223 @ f6fbb35d8ac9 (draft): B
224 |
225 o f5bc6836db60 (draft): A
226 |
227 o a9bdc8b26820 (public): O
228
229 $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(A)'`
230 $ hg debugobsolete
231 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
232 $ cd ..
233 $ cd ..
234
235 setup both variants
236
237 $ cp -r A.1.2 A.1.2.a
238 $ cp -r A.1.2 A.1.2.b
239
240
241 Variante a: push -r A
242 ---------------------
243
244 $ cd A.1.2.a
245 $ hg -R source id -r 'desc(B)'
246 f6fbb35d8ac9 tip
247 $ hg -R source debugobsolete
248 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
249 $ hg -R dest debugobsolete
250 $ hg -R other debugobsolete
251
252 $ hg -R source push -r 'desc(B)' dest
253 pushing to dest
254 searching for changes
255 adding changesets
256 adding manifests
257 adding file changes
258 added 2 changesets with 2 changes to 2 files
259 OBSEXC: computing relevant nodes
260 OBSEXC: computing markers relevant to 3 nodes
261 OBSEXC: encoding 1 markers
262 OBSEXC: sending 1 pushkey payload (78 bytes)
263 OBSEXC: DONE
264 $ hg -R source debugobsolete
265 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
266 $ hg -R dest debugobsolete
267 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
268 $ hg -R other debugobsolete
269
270 $ hg -R other pull -r 'f6fbb35d8ac9' dest
271 pulling from dest
272 searching for changes
273 adding changesets
274 adding manifests
275 adding file changes
276 added 2 changesets with 2 changes to 2 files
277 OBSEXC: pull obsolescence markers
278 OBSEXC: merging obsolescence markers (62 bytes)
279 OBSEXC: 1 markers added
280 OBSEXC: DONE
281 (run 'hg update' to get a working copy)
282 $ hg -R source debugobsolete
283 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
284 $ hg -R dest debugobsolete
285 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
286 $ hg -R other debugobsolete
287 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
288
289 $ cd ..
290
291 Variante b: push
292 ---------------------
293
294 $ cd A.1.2.b
295 $ hg -R source id -r 'desc(B)'
296 f6fbb35d8ac9 tip
297 $ hg -R source debugobsolete
298 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
299 $ hg -R dest debugobsolete
300 $ hg -R other debugobsolete
301
302 $ hg -R source push dest
303 pushing to dest
304 searching for changes
305 adding changesets
306 adding manifests
307 adding file changes
308 added 2 changesets with 2 changes to 2 files
309 OBSEXC: computing relevant nodes
310 OBSEXC: computing markers relevant to 3 nodes
311 OBSEXC: encoding 1 markers
312 OBSEXC: sending 1 pushkey payload (78 bytes)
313 OBSEXC: DONE
314 $ hg -R source debugobsolete
315 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
316 $ hg -R dest debugobsolete
317 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
318 $ hg -R other debugobsolete
319
320 $ hg -R other pull dest
321 pulling from dest
322 searching for changes
323 adding changesets
324 adding manifests
325 adding file changes
326 added 2 changesets with 2 changes to 2 files
327 OBSEXC: pull obsolescence markers
328 OBSEXC: merging obsolescence markers (62 bytes)
329 OBSEXC: 1 markers added
330 OBSEXC: DONE
331 (run 'hg update' to get a working copy)
332 $ hg -R source debugobsolete
333 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
334 $ hg -R dest debugobsolete
335 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
336 $ hg -R other debugobsolete
337 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa f5bc6836db60e308a17ba08bf050154ba9c4fad7 0 {'date': '', 'user': 'test'}
338
339 $ cd ..