Debian Codegraph @

tests/test-treediscovery-legacy.t

raw
1 Tests discovery against servers without getbundle support:
2
3 $ cat >> $HGRCPATH <<EOF
4 > [ui]
5 > logtemplate="{rev} {node|short}: {desc} {branches}\n"
6 > EOF
7 $ cp $HGRCPATH $HGRCPATH-withcap
8
9 $ CAP="getbundle known changegroupsubset bundle2"
10 $ . "$TESTDIR/notcapable"
11 $ cp $HGRCPATH $HGRCPATH-nocap
12 $ cp $HGRCPATH-withcap $HGRCPATH
13
14 Prep for test server without branchmap support
15
16 $ CAP="branchmap"
17 $ . "$TESTDIR/notcapable"
18 $ cp $HGRCPATH $HGRCPATH-nocap-branchmap
19 $ cp $HGRCPATH-withcap $HGRCPATH
20
21 Setup HTTP server control:
22
23 $ remote=http://localhost:$HGPORT/
24 $ export remote
25 $ tstart() {
26 > echo '[web]' > $1/.hg/hgrc
27 > echo 'push_ssl = false' >> $1/.hg/hgrc
28 > echo 'allow_push = *' >> $1/.hg/hgrc
29 > cp $HGRCPATH-nocap $HGRCPATH
30 > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -E errors.log
31 > cat hg.pid >> $DAEMON_PIDS
32 > }
33 $ tstop() {
34 > killdaemons.py
35 > cp $HGRCPATH-withcap $HGRCPATH
36 > }
37
38 Both are empty:
39
40 $ hg init empty1
41 $ hg init empty2
42 $ tstart empty2
43 $ hg incoming -R empty1 $remote
44 comparing with http://localhost:$HGPORT/
45 no changes found
46 [1]
47 $ hg outgoing -R empty1 $remote
48 comparing with http://localhost:$HGPORT/
49 no changes found
50 [1]
51 $ hg pull -R empty1 $remote
52 pulling from http://localhost:$HGPORT/
53 no changes found
54 $ hg push -R empty1 $remote
55 pushing to http://localhost:$HGPORT/
56 no changes found
57 [1]
58 $ tstop
59
60 Base repo:
61
62 $ hg init main
63 $ cd main
64 $ hg debugbuilddag -mo '+2:tbase @name1 +3:thead1 <tbase @name2 +4:thead2 @both /thead1 +2:tmaintip'
65 $ hg log -G
66 o 11 a19bfa7e7328: r11 both
67 |
68 o 10 8b6bad1512e1: r10 both
69 |
70 o 9 025829e08038: r9 both
71 |\
72 | o 8 d8f638ac69e9: r8 name2
73 | |
74 | o 7 b6b4d315a2ac: r7 name2
75 | |
76 | o 6 6c6f5d5f3c11: r6 name2
77 | |
78 | o 5 70314b29987d: r5 name2
79 | |
80 o | 4 e71dbbc70e03: r4 name1
81 | |
82 o | 3 2c8d5d5ec612: r3 name1
83 | |
84 o | 2 a7892891da29: r2 name1
85 |/
86 o 1 0019a3b924fd: r1
87 |
88 o 0 d57206cc072a: r0
89
90 $ cd ..
91 $ tstart main
92
93 Full clone:
94
95 $ hg clone main full
96 updating to branch default
97 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 $ cd full
99 $ hg incoming $remote
100 comparing with http://localhost:$HGPORT/
101 searching for changes
102 no changes found
103 [1]
104 $ hg outgoing $remote
105 comparing with http://localhost:$HGPORT/
106 searching for changes
107 no changes found
108 [1]
109 $ hg pull $remote
110 pulling from http://localhost:$HGPORT/
111 searching for changes
112 no changes found
113 $ hg push $remote
114 pushing to http://localhost:$HGPORT/
115 searching for changes
116 no changes found
117 [1]
118 $ cd ..
119
120 Local is empty:
121
122 $ cd empty1
123 $ hg incoming $remote --rev name1
124 comparing with http://localhost:$HGPORT/
125 abort: cannot look up remote changes; remote repository does not support the 'changegroupsubset' capability
126 [255]
127 $ hg incoming $remote
128 comparing with http://localhost:$HGPORT/
129 0 d57206cc072a: r0
130 1 0019a3b924fd: r1
131 2 a7892891da29: r2 name1
132 3 2c8d5d5ec612: r3 name1
133 4 e71dbbc70e03: r4 name1
134 5 70314b29987d: r5 name2
135 6 6c6f5d5f3c11: r6 name2
136 7 b6b4d315a2ac: r7 name2
137 8 d8f638ac69e9: r8 name2
138 9 025829e08038: r9 both
139 10 8b6bad1512e1: r10 both
140 11 a19bfa7e7328: r11 both
141 $ hg outgoing $remote
142 comparing with http://localhost:$HGPORT/
143 no changes found
144 [1]
145 $ hg push $remote
146 pushing to http://localhost:$HGPORT/
147 no changes found
148 [1]
149 $ hg pull $remote
150 pulling from http://localhost:$HGPORT/
151 requesting all changes
152 adding changesets
153 adding manifests
154 adding file changes
155 added 12 changesets with 24 changes to 2 files
156 new changesets d57206cc072a:a19bfa7e7328
157 (run 'hg update' to get a working copy)
158 $ hg incoming $remote
159 comparing with http://localhost:$HGPORT/
160 searching for changes
161 no changes found
162 [1]
163 $ cd ..
164
165 Local is subset:
166
167 $ cp $HGRCPATH-withcap $HGRCPATH
168 $ hg clone main subset --rev name2 ; cd subset
169 adding changesets
170 adding manifests
171 adding file changes
172 added 6 changesets with 12 changes to 2 files
173 new changesets d57206cc072a:d8f638ac69e9
174 updating to branch name2
175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 $ cp $HGRCPATH-nocap $HGRCPATH
177 $ hg incoming $remote
178 comparing with http://localhost:$HGPORT/
179 searching for changes
180 6 a7892891da29: r2 name1
181 7 2c8d5d5ec612: r3 name1
182 8 e71dbbc70e03: r4 name1
183 9 025829e08038: r9 both
184 10 8b6bad1512e1: r10 both
185 11 a19bfa7e7328: r11 both
186 $ hg outgoing $remote
187 comparing with http://localhost:$HGPORT/
188 searching for changes
189 no changes found
190 [1]
191 $ hg push $remote
192 pushing to http://localhost:$HGPORT/
193 searching for changes
194 no changes found
195 [1]
196 $ hg pull $remote
197 pulling from http://localhost:$HGPORT/
198 searching for changes
199 adding changesets
200 adding manifests
201 adding file changes
202 added 6 changesets with 12 changes to 2 files
203 new changesets a7892891da29:a19bfa7e7328
204 (run 'hg update' to get a working copy)
205 $ hg incoming $remote
206 comparing with http://localhost:$HGPORT/
207 searching for changes
208 no changes found
209 [1]
210 $ cd ..
211
212 Remote is empty:
213
214 $ tstop ; tstart empty2
215 $ cd main
216 $ hg incoming $remote
217 comparing with http://localhost:$HGPORT/
218 searching for changes
219 no changes found
220 [1]
221 $ hg outgoing $remote
222 comparing with http://localhost:$HGPORT/
223 searching for changes
224 0 d57206cc072a: r0
225 1 0019a3b924fd: r1
226 2 a7892891da29: r2 name1
227 3 2c8d5d5ec612: r3 name1
228 4 e71dbbc70e03: r4 name1
229 5 70314b29987d: r5 name2
230 6 6c6f5d5f3c11: r6 name2
231 7 b6b4d315a2ac: r7 name2
232 8 d8f638ac69e9: r8 name2
233 9 025829e08038: r9 both
234 10 8b6bad1512e1: r10 both
235 11 a19bfa7e7328: r11 both
236 $ hg pull $remote
237 pulling from http://localhost:$HGPORT/
238 searching for changes
239 no changes found
240 $ hg push $remote
241 pushing to http://localhost:$HGPORT/
242 searching for changes
243 remote: adding changesets
244 remote: adding manifests
245 remote: adding file changes
246 remote: added 12 changesets with 24 changes to 2 files
247 $ hg outgoing $remote
248 comparing with http://localhost:$HGPORT/
249 searching for changes
250 no changes found
251 [1]
252 $ cd ..
253
254 Local is superset:
255
256 $ tstop
257 $ hg clone main subset2 --rev name2
258 adding changesets
259 adding manifests
260 adding file changes
261 added 6 changesets with 12 changes to 2 files
262 new changesets d57206cc072a:d8f638ac69e9
263 updating to branch name2
264 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
265 $ tstart subset2
266 $ cd main
267 $ hg incoming $remote
268 comparing with http://localhost:$HGPORT/
269 searching for changes
270 no changes found
271 [1]
272 $ hg outgoing $remote
273 comparing with http://localhost:$HGPORT/
274 searching for changes
275 2 a7892891da29: r2 name1
276 3 2c8d5d5ec612: r3 name1
277 4 e71dbbc70e03: r4 name1
278 9 025829e08038: r9 both
279 10 8b6bad1512e1: r10 both
280 11 a19bfa7e7328: r11 both
281 $ hg pull $remote
282 pulling from http://localhost:$HGPORT/
283 searching for changes
284 no changes found
285 $ hg push $remote
286 pushing to http://localhost:$HGPORT/
287 searching for changes
288 abort: push creates new remote branches: both, name1
289 (use 'hg push --new-branch' to create new remote branches)
290 [20]
291 $ hg push $remote --new-branch
292 pushing to http://localhost:$HGPORT/
293 searching for changes
294 remote: adding changesets
295 remote: adding manifests
296 remote: adding file changes
297 remote: added 6 changesets with 12 changes to 2 files
298 $ hg outgoing $remote
299 comparing with http://localhost:$HGPORT/
300 searching for changes
301 no changes found
302 [1]
303 $ cd ..
304
305 Partial pull:
306
307 $ tstop ; tstart main
308 $ hg clone $remote partial --rev name2
309 abort: partial pull cannot be done because other repository doesn't support changegroupsubset.
310 [255]
311 $ hg init partial; cd partial
312 $ hg incoming $remote --rev name2
313 comparing with http://localhost:$HGPORT/
314 abort: cannot look up remote changes; remote repository does not support the 'changegroupsubset' capability
315 [255]
316 $ hg pull $remote --rev name2
317 pulling from http://localhost:$HGPORT/
318 abort: partial pull cannot be done because other repository doesn't support changegroupsubset.
319 [255]
320 $ cd ..
321
322 $ tstop
323
324 Exercise pushing to server without branchmap capability
325
326 $ cp $HGRCPATH-nocap-branchmap $HGRCPATH-nocap
327 $ hg init rlocal
328 $ cd rlocal
329 $ echo A > A
330 $ hg ci -Am A
331 adding A
332 $ cd ..
333 $ hg clone rlocal rremote
334 updating to branch default
335 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
336 $ cd rlocal
337 $ echo B > B
338 $ hg ci -Am B
339 adding B
340 $ cd ..
341 $ tstart rremote
342
343 $ cd rlocal
344 $ hg incoming $remote
345 comparing with http://localhost:$HGPORT/
346 searching for changes
347 no changes found
348 [1]
349 $ hg outgoing $remote
350 comparing with http://localhost:$HGPORT/
351 searching for changes
352 1 27547f69f254: B
353 $ hg pull $remote
354 pulling from http://localhost:$HGPORT/
355 searching for changes
356 no changes found
357 1 local changesets published
358 $ hg push $remote
359 pushing to http://localhost:$HGPORT/
360 searching for changes
361 remote: adding changesets
362 remote: adding manifests
363 remote: adding file changes
364 remote: added 1 changesets with 1 changes to 1 files
365 $ hg outgoing $remote
366 comparing with http://localhost:$HGPORT/
367 searching for changes
368 no changes found
369 [1]
370 $ cd ..
371
372 $ tstop