##// END OF EJS Templates
tests: show graph log before and after widening in more cases...
Martin von Zweigbergk -
r43516:a151606a default draft
parent child Browse files
Show More
@@ -1,362 +1,452 b''
1 #testcases flat tree
1 #testcases flat tree
2 $ . "$TESTDIR/narrow-library.sh"
2 $ . "$TESTDIR/narrow-library.sh"
3
3
4 $ cat >> $HGRCPATH <<EOF
5 > [alias]
6 > l = log -G -T "{if(ellipsis, '...')}{rev}: {desc}\n"
7 > EOF
8
4 #if tree
9 #if tree
5 $ cat << EOF >> $HGRCPATH
10 $ cat << EOF >> $HGRCPATH
6 > [experimental]
11 > [experimental]
7 > treemanifest = 1
12 > treemanifest = 1
8 > EOF
13 > EOF
9 #endif
14 #endif
10
15
11 $ hg init master
16 $ hg init master
12 $ cd master
17 $ cd master
13 $ cat >> .hg/hgrc <<EOF
18 $ cat >> .hg/hgrc <<EOF
14 > [narrow]
19 > [narrow]
15 > serveellipses=True
20 > serveellipses=True
16 > EOF
21 > EOF
17
22
18 $ mkdir inside
23 $ mkdir inside
19 $ echo 'inside' > inside/f
24 $ echo 'inside' > inside/f
20 $ hg add inside/f
25 $ hg add inside/f
21 $ hg commit -m 'add inside'
26 $ hg commit -m 'add inside'
22
27
23 $ mkdir widest
28 $ mkdir widest
24 $ echo 'widest' > widest/f
29 $ echo 'widest' > widest/f
25 $ hg add widest/f
30 $ hg add widest/f
26 $ hg commit -m 'add widest'
31 $ hg commit -m 'add widest'
27
32
28 $ mkdir outside
33 $ mkdir outside
29 $ echo 'outside' > outside/f
34 $ echo 'outside' > outside/f
30 $ hg add outside/f
35 $ hg add outside/f
31 $ hg commit -m 'add outside'
36 $ hg commit -m 'add outside'
32
37
33 $ cd ..
38 $ cd ..
34
39
35 narrow clone the inside file
40 narrow clone the inside file
36
41
37 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
42 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
38 requesting all changes
43 requesting all changes
39 adding changesets
44 adding changesets
40 adding manifests
45 adding manifests
41 adding file changes
46 adding file changes
42 added 2 changesets with 1 changes to 1 files
47 added 2 changesets with 1 changes to 1 files
43 new changesets *:* (glob)
48 new changesets *:* (glob)
44 updating to branch default
49 updating to branch default
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cd narrow
51 $ cd narrow
47 $ hg tracked
52 $ hg tracked
48 I path:inside
53 I path:inside
49 $ ls
54 $ ls
50 inside
55 inside
51 $ cat inside/f
56 $ cat inside/f
52 inside
57 inside
53 $ cd ..
58 $ cd ..
54
59
55 add more upstream files which we will include in a wider narrow spec
60 add more upstream files which we will include in a wider narrow spec
56
61
57 $ cd master
62 $ cd master
58
63
59 $ mkdir wider
64 $ mkdir wider
60 $ echo 'wider' > wider/f
65 $ echo 'wider' > wider/f
61 $ hg add wider/f
66 $ hg add wider/f
62 $ echo 'widest v2' > widest/f
67 $ echo 'widest v2' > widest/f
63 $ hg commit -m 'add wider, update widest'
68 $ hg commit -m 'add wider, update widest'
64
69
65 $ echo 'widest v3' > widest/f
70 $ echo 'widest v3' > widest/f
66 $ hg commit -m 'update widest v3'
71 $ hg commit -m 'update widest v3'
67
72
68 $ echo 'inside v2' > inside/f
73 $ echo 'inside v2' > inside/f
69 $ hg commit -m 'update inside'
74 $ hg commit -m 'update inside'
70
75
71 $ mkdir outside2
76 $ mkdir outside2
72 $ echo 'outside2' > outside2/f
77 $ echo 'outside2' > outside2/f
73 $ hg add outside2/f
78 $ hg add outside2/f
74 $ hg commit -m 'add outside2'
79 $ hg commit -m 'add outside2'
75
80
76 $ echo 'widest v4' > widest/f
81 $ echo 'widest v4' > widest/f
77 $ hg commit -m 'update widest v4'
82 $ hg commit -m 'update widest v4'
78
83
79 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
84 $ hg l
80 7: update widest v4
85 @ 7: update widest v4
81 6: add outside2
86 |
82 5: update inside
87 o 6: add outside2
83 4: update widest v3
88 |
84 3: add wider, update widest
89 o 5: update inside
85 2: add outside
90 |
86 1: add widest
91 o 4: update widest v3
87 0: add inside
92 |
93 o 3: add wider, update widest
94 |
95 o 2: add outside
96 |
97 o 1: add widest
98 |
99 o 0: add inside
100
88
101
89 $ cd ..
102 $ cd ..
90
103
91 Widen the narrow spec to see the widest file. This should not get the newly
104 Widen the narrow spec to see the widest file. This should not get the newly
92 added upstream revisions.
105 added upstream revisions.
93
106
94 $ cd narrow
107 $ cd narrow
108 $ hg l
109 @ ...1: add outside
110 |
111 o 0: add inside
112
95 $ hg tracked --addinclude widest/f
113 $ hg tracked --addinclude widest/f
96 comparing with ssh://user@dummy/master
114 comparing with ssh://user@dummy/master
97 searching for changes
115 searching for changes
98 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
116 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
99 adding changesets
117 adding changesets
100 adding manifests
118 adding manifests
101 adding file changes
119 adding file changes
102 added 3 changesets with 2 changes to 2 files
120 added 3 changesets with 2 changes to 2 files
121 $ hg l
122 @ ...2: add outside
123 |
124 o 1: add widest
125 |
126 o 0: add inside
127
103 $ hg tracked
128 $ hg tracked
104 I path:inside
129 I path:inside
105 I path:widest/f
130 I path:widest/f
106
131
107 $ cat widest/f
132 $ cat widest/f
108 widest
133 widest
109
134
110 Pull down the newly added upstream revision.
135 Pull down the newly added upstream revision.
111
136
112 $ hg pull
137 $ hg pull
113 pulling from ssh://user@dummy/master
138 pulling from ssh://user@dummy/master
114 searching for changes
139 searching for changes
115 adding changesets
140 adding changesets
116 adding manifests
141 adding manifests
117 adding file changes
142 adding file changes
118 added 5 changesets with 4 changes to 2 files
143 added 5 changesets with 4 changes to 2 files
119 new changesets *:* (glob)
144 new changesets *:* (glob)
120 (run 'hg update' to get a working copy)
145 (run 'hg update' to get a working copy)
121 $ hg update -r 'desc("add wider")'
146 $ hg update -r 'desc("add wider")'
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 $ cat widest/f
148 $ cat widest/f
124 widest v2
149 widest v2
125
150
126 $ hg update -r 'desc("update inside")'
151 $ hg update -r 'desc("update inside")'
127 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
128 $ cat widest/f
153 $ cat widest/f
129 widest v3
154 widest v3
130 $ cat inside/f
155 $ cat inside/f
131 inside v2
156 inside v2
132
157
133 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
158 $ hg l
134 7: update widest v4
159 o 7: update widest v4
135 ...6: add outside2
160 |
136 5: update inside
161 o ...6: add outside2
137 4: update widest v3
162 |
138 3: add wider, update widest
163 @ 5: update inside
139 ...2: add outside
164 |
140 1: add widest
165 o 4: update widest v3
141 0: add inside
166 |
167 o 3: add wider, update widest
168 |
169 o ...2: add outside
170 |
171 o 1: add widest
172 |
173 o 0: add inside
174
142
175
143 Check that widening with a newline fails
176 Check that widening with a newline fails
144
177
145 $ hg tracked --addinclude 'widest
178 $ hg tracked --addinclude 'widest
146 > '
179 > '
147 abort: newlines are not allowed in narrowspec paths
180 abort: newlines are not allowed in narrowspec paths
148 [255]
181 [255]
149
182
150 widen the narrow spec to include the wider file
183 widen the narrow spec to include the wider file
151
184
152 $ hg tracked --addinclude wider
185 $ hg tracked --addinclude wider
153 comparing with ssh://user@dummy/master
186 comparing with ssh://user@dummy/master
154 searching for changes
187 searching for changes
155 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
188 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
156 adding changesets
189 adding changesets
157 adding manifests
190 adding manifests
158 adding file changes
191 adding file changes
159 added 8 changesets with 7 changes to 3 files
192 added 8 changesets with 7 changes to 3 files
160 $ hg tracked
193 $ hg tracked
161 I path:inside
194 I path:inside
162 I path:wider
195 I path:wider
163 I path:widest/f
196 I path:widest/f
164 $ hg update 'desc("add widest")'
197 $ hg update 'desc("add widest")'
165 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
198 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
166 $ cat widest/f
199 $ cat widest/f
167 widest
200 widest
168 $ hg update 'desc("add wider, update widest")'
201 $ hg update 'desc("add wider, update widest")'
169 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
202 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 $ cat wider/f
203 $ cat wider/f
171 wider
204 wider
172 $ cat widest/f
205 $ cat widest/f
173 widest v2
206 widest v2
174 $ hg update 'desc("update widest v3")'
207 $ hg update 'desc("update widest v3")'
175 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 $ cat widest/f
209 $ cat widest/f
177 widest v3
210 widest v3
178 $ hg update 'desc("update widest v4")'
211 $ hg update 'desc("update widest v4")'
179 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
212 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
180 $ cat widest/f
213 $ cat widest/f
181 widest v4
214 widest v4
182
215
183 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
216 $ hg l
184 7: update widest v4
217 @ 7: update widest v4
185 ...6: add outside2
218 |
186 5: update inside
219 o ...6: add outside2
187 4: update widest v3
220 |
188 3: add wider, update widest
221 o 5: update inside
189 ...2: add outside
222 |
190 1: add widest
223 o 4: update widest v3
191 0: add inside
224 |
225 o 3: add wider, update widest
226 |
227 o ...2: add outside
228 |
229 o 1: add widest
230 |
231 o 0: add inside
232
192
233
193 separate suite of tests: files from 0-10 modified in changes 0-10. This allows
234 separate suite of tests: files from 0-10 modified in changes 0-10. This allows
194 more obvious precise tests tickling particular corner cases.
235 more obvious precise tests tickling particular corner cases.
195
236
196 $ cd ..
237 $ cd ..
197 $ hg init upstream
238 $ hg init upstream
198 $ cd upstream
239 $ cd upstream
199 $ cat >> .hg/hgrc <<EOF
240 $ cat >> .hg/hgrc <<EOF
200 > [narrow]
241 > [narrow]
201 > serveellipses=True
242 > serveellipses=True
202 > EOF
243 > EOF
203 $ for x in `$TESTDIR/seq.py 0 10`
244 $ for x in `$TESTDIR/seq.py 0 10`
204 > do
245 > do
205 > mkdir d$x
246 > mkdir d$x
206 > echo $x > d$x/f
247 > echo $x > d$x/f
207 > hg add d$x/f
248 > hg add d$x/f
208 > hg commit -m "add d$x/f"
249 > hg commit -m "add d$x/f"
209 > done
250 > done
210 $ hg log -T "{rev}: {desc}\n"
251 $ hg log -T "{rev}: {desc}\n"
211 10: add d10/f
252 10: add d10/f
212 9: add d9/f
253 9: add d9/f
213 8: add d8/f
254 8: add d8/f
214 7: add d7/f
255 7: add d7/f
215 6: add d6/f
256 6: add d6/f
216 5: add d5/f
257 5: add d5/f
217 4: add d4/f
258 4: add d4/f
218 3: add d3/f
259 3: add d3/f
219 2: add d2/f
260 2: add d2/f
220 1: add d1/f
261 1: add d1/f
221 0: add d0/f
262 0: add d0/f
222
263
223 make narrow clone with every third node.
264 make narrow clone with every third node.
224
265
225 $ cd ..
266 $ cd ..
226 $ hg clone --narrow ssh://user@dummy/upstream narrow2 --include d0 --include d3 --include d6 --include d9
267 $ hg clone --narrow ssh://user@dummy/upstream narrow2 --include d0 --include d3 --include d6 --include d9
227 requesting all changes
268 requesting all changes
228 adding changesets
269 adding changesets
229 adding manifests
270 adding manifests
230 adding file changes
271 adding file changes
231 added 8 changesets with 4 changes to 4 files
272 added 8 changesets with 4 changes to 4 files
232 new changesets *:* (glob)
273 new changesets *:* (glob)
233 updating to branch default
274 updating to branch default
234 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 $ cd narrow2
276 $ cd narrow2
236 $ hg tracked
277 $ hg tracked
237 I path:d0
278 I path:d0
238 I path:d3
279 I path:d3
239 I path:d6
280 I path:d6
240 I path:d9
281 I path:d9
241 $ hg verify
282 $ hg verify
242 checking changesets
283 checking changesets
243 checking manifests
284 checking manifests
244 checking directory manifests (tree !)
285 checking directory manifests (tree !)
245 crosschecking files in changesets and manifests
286 crosschecking files in changesets and manifests
246 checking files
287 checking files
247 checked 8 changesets with 4 changes to 4 files
288 checked 8 changesets with 4 changes to 4 files
248 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
289 $ hg l
249 ...7: add d10/f
290 @ ...7: add d10/f
250 6: add d9/f
291 |
251 ...5: add d8/f
292 o 6: add d9/f
252 4: add d6/f
293 |
253 ...3: add d5/f
294 o ...5: add d8/f
254 2: add d3/f
295 |
255 ...1: add d2/f
296 o 4: add d6/f
256 0: add d0/f
297 |
298 o ...3: add d5/f
299 |
300 o 2: add d3/f
301 |
302 o ...1: add d2/f
303 |
304 o 0: add d0/f
305
257 $ hg tracked --addinclude d1
306 $ hg tracked --addinclude d1
258 comparing with ssh://user@dummy/upstream
307 comparing with ssh://user@dummy/upstream
259 searching for changes
308 searching for changes
260 saved backup bundle to $TESTTMP/narrow2/.hg/strip-backup/*-widen.hg (glob)
309 saved backup bundle to $TESTTMP/narrow2/.hg/strip-backup/*-widen.hg (glob)
261 adding changesets
310 adding changesets
262 adding manifests
311 adding manifests
263 adding file changes
312 adding file changes
264 added 9 changesets with 5 changes to 5 files
313 added 9 changesets with 5 changes to 5 files
265 $ hg tracked
314 $ hg tracked
266 I path:d0
315 I path:d0
267 I path:d1
316 I path:d1
268 I path:d3
317 I path:d3
269 I path:d6
318 I path:d6
270 I path:d9
319 I path:d9
271 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
320 $ hg l
272 ...8: add d10/f
321 @ ...8: add d10/f
273 7: add d9/f
322 |
274 ...6: add d8/f
323 o 7: add d9/f
275 5: add d6/f
324 |
276 ...4: add d5/f
325 o ...6: add d8/f
277 3: add d3/f
326 |
278 ...2: add d2/f
327 o 5: add d6/f
279 1: add d1/f
328 |
280 0: add d0/f
329 o ...4: add d5/f
330 |
331 o 3: add d3/f
332 |
333 o ...2: add d2/f
334 |
335 o 1: add d1/f
336 |
337 o 0: add d0/f
338
281
339
282 Verify shouldn't claim the repo is corrupt after a widen.
340 Verify shouldn't claim the repo is corrupt after a widen.
283
341
284 $ hg verify
342 $ hg verify
285 checking changesets
343 checking changesets
286 checking manifests
344 checking manifests
287 checking directory manifests (tree !)
345 checking directory manifests (tree !)
288 crosschecking files in changesets and manifests
346 crosschecking files in changesets and manifests
289 checking files
347 checking files
290 checked 9 changesets with 5 changes to 5 files
348 checked 9 changesets with 5 changes to 5 files
291
349
292 Widening preserves parent of local commit
350 Widening preserves parent of local commit
293
351
294 $ cd ..
352 $ cd ..
295 $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2
353 $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2
296 $ cd narrow3
354 $ cd narrow3
297 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
355 $ hg l
298 1: add d2/f
356 @ 1: add d2/f
299 ...0: add d1/f
357 |
358 o ...0: add d1/f
359
300 $ hg pull -q -r 3
360 $ hg pull -q -r 3
301 $ hg co -q tip
361 $ hg co -q tip
302 $ hg pull -q -r 4
362 $ hg pull -q -r 4
303 $ echo local > d2/f
363 $ echo local > d2/f
304 $ hg ci -m local
364 $ hg ci -m local
305 created new head
365 created new head
366 $ hg l
367 @ 4: local
368 |
369 | o ...3: add d4/f
370 |/
371 o ...2: add d3/f
372 |
373 o 1: add d2/f
374 |
375 o ...0: add d1/f
376
306 $ hg tracked -q --addinclude d0 --addinclude d9
377 $ hg tracked -q --addinclude d0 --addinclude d9
378 $ hg l
379 @ 5: local
380 |
381 | o ...4: add d4/f
382 |/
383 o ...3: add d3/f
384 |
385 o 2: add d2/f
386 |
387 o ...1: add d1/f
388 |
389 o 0: add d0/f
390
307
391
308 Widening preserves bookmarks
392 Widening preserves bookmarks
309
393
310 $ cd ..
394 $ cd ..
311 $ hg clone -q --narrow ssh://user@dummy/upstream narrow-bookmarks --include d4
395 $ hg clone -q --narrow ssh://user@dummy/upstream narrow-bookmarks --include d4
312 $ cd narrow-bookmarks
396 $ cd narrow-bookmarks
313 $ echo local > d4/f
397 $ echo local > d4/f
314 $ hg ci -m local
398 $ hg ci -m local
315 $ hg bookmarks bookmark
399 $ hg bookmarks bookmark
316 $ hg bookmarks
400 $ hg bookmarks
317 * bookmark 3:* (glob)
401 * bookmark 3:* (glob)
318 $ hg -q tracked --addinclude d2
402 $ hg -q tracked --addinclude d2
319 $ hg bookmarks
403 $ hg bookmarks
320 * bookmark 5:* (glob)
404 * bookmark 5:* (glob)
321 $ hg log -r bookmark -T '{desc}\n'
405 $ hg log -r bookmark -T '{desc}\n'
322 local
406 local
323
407
324 Widening that fails can be recovered from
408 Widening that fails can be recovered from
325
409
326 $ cd ..
410 $ cd ..
327 $ hg clone -q --narrow ssh://user@dummy/upstream interrupted --include d0
411 $ hg clone -q --narrow ssh://user@dummy/upstream interrupted --include d0
328 $ cd interrupted
412 $ cd interrupted
329 $ echo local > d0/f
413 $ echo local > d0/f
330 $ hg ci -m local
414 $ hg ci -m local
331 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
415 $ hg l
332 2: local
416 @ 2: local
333 ...1: add d10/f
417 |
334 0: add d0/f
418 o ...1: add d10/f
419 |
420 o 0: add d0/f
421
335 $ hg bookmarks bookmark
422 $ hg bookmarks bookmark
336 $ hg --config hooks.pretxnchangegroup.bad=false tracked --addinclude d1
423 $ hg --config hooks.pretxnchangegroup.bad=false tracked --addinclude d1
337 comparing with ssh://user@dummy/upstream
424 comparing with ssh://user@dummy/upstream
338 searching for changes
425 searching for changes
339 saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/*-widen.hg (glob)
426 saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/*-widen.hg (glob)
340 adding changesets
427 adding changesets
341 adding manifests
428 adding manifests
342 adding file changes
429 adding file changes
343 transaction abort!
430 transaction abort!
344 rollback completed
431 rollback completed
345 abort: pretxnchangegroup.bad hook exited with status 1
432 abort: pretxnchangegroup.bad hook exited with status 1
346 [255]
433 [255]
347 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
434 $ hg l
348 $ hg bookmarks
435 $ hg bookmarks
349 no bookmarks set
436 no bookmarks set
350 $ hg unbundle .hg/strip-backup/*-widen.hg
437 $ hg unbundle .hg/strip-backup/*-widen.hg
351 adding changesets
438 adding changesets
352 adding manifests
439 adding manifests
353 adding file changes
440 adding file changes
354 added 3 changesets with 2 changes to 1 files
441 added 3 changesets with 2 changes to 1 files
355 new changesets *:* (glob)
442 new changesets *:* (glob)
356 (run 'hg update' to get a working copy)
443 (run 'hg update' to get a working copy)
357 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
444 $ hg l
358 2: local
445 o 2: local
359 ...1: add d10/f
446 |
360 0: add d0/f
447 o ...1: add d10/f
448 |
449 o 0: add d0/f
450
361 $ hg bookmarks
451 $ hg bookmarks
362 * bookmark 2:* (glob)
452 * bookmark 2:* (glob)
General Comments 0
You need to be logged in to leave comments. Login now