Mercurial > hg
comparison tests/test-narrow-widen-no-ellipsis.t @ 39363:048333ef0169
tests: rename test-narrow-widen-non-ellipsis to match current names
The test is renamed to test-narrow-widen-no-ellipsis (note non -> no), to match
with test-narrow-clone-no-ellipsis.t.
Follows up on D4382.
Differential Revision: https://phab.mercurial-scm.org/D4423
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Thu, 30 Aug 2018 13:05:59 +0300 |
parents | tests/test-narrow-widen-non-ellipsis.t@5ebfb7cc6f2c |
children | 3d8b73c0fadf |
comparison
equal
deleted
inserted
replaced
39362:438f3932a432 | 39363:048333ef0169 |
---|---|
1 #testcases tree flat | |
2 $ . "$TESTDIR/narrow-library.sh" | |
3 | |
4 #if tree | |
5 $ cat << EOF >> $HGRCPATH | |
6 > [experimental] | |
7 > treemanifest = 1 | |
8 > EOF | |
9 #endif | |
10 | |
11 $ hg init master | |
12 $ cd master | |
13 | |
14 $ mkdir inside | |
15 $ echo 'inside' > inside/f | |
16 $ hg add inside/f | |
17 $ hg commit -m 'add inside' | |
18 | |
19 $ mkdir widest | |
20 $ echo 'widest' > widest/f | |
21 $ hg add widest/f | |
22 $ hg commit -m 'add widest' | |
23 | |
24 $ mkdir outside | |
25 $ echo 'outside' > outside/f | |
26 $ hg add outside/f | |
27 $ hg commit -m 'add outside' | |
28 | |
29 $ cd .. | |
30 | |
31 narrow clone the inside file | |
32 | |
33 $ hg clone --narrow ssh://user@dummy/master narrow --include inside | |
34 requesting all changes | |
35 adding changesets | |
36 adding manifests | |
37 adding file changes | |
38 added 3 changesets with 1 changes to 1 files | |
39 new changesets *:* (glob) | |
40 updating to branch default | |
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 $ cd narrow | |
43 $ hg tracked | |
44 I path:inside | |
45 $ ls | |
46 inside | |
47 $ cat inside/f | |
48 inside | |
49 $ cd .. | |
50 | |
51 add more upstream files which we will include in a wider narrow spec | |
52 | |
53 $ cd master | |
54 | |
55 $ mkdir wider | |
56 $ echo 'wider' > wider/f | |
57 $ hg add wider/f | |
58 $ echo 'widest v2' > widest/f | |
59 $ hg commit -m 'add wider, update widest' | |
60 | |
61 $ echo 'widest v3' > widest/f | |
62 $ hg commit -m 'update widest v3' | |
63 | |
64 $ echo 'inside v2' > inside/f | |
65 $ hg commit -m 'update inside' | |
66 | |
67 $ mkdir outside2 | |
68 $ echo 'outside2' > outside2/f | |
69 $ hg add outside2/f | |
70 $ hg commit -m 'add outside2' | |
71 | |
72 $ echo 'widest v4' > widest/f | |
73 $ hg commit -m 'update widest v4' | |
74 | |
75 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
76 7: update widest v4 | |
77 6: add outside2 | |
78 5: update inside | |
79 4: update widest v3 | |
80 3: add wider, update widest | |
81 2: add outside | |
82 1: add widest | |
83 0: add inside | |
84 | |
85 $ cd .. | |
86 | |
87 Widen the narrow spec to see the wider file. This should not get the newly | |
88 added upstream revisions. | |
89 | |
90 $ cd narrow | |
91 $ hg tracked --addinclude wider/f | |
92 comparing with ssh://user@dummy/master | |
93 searching for changes | |
94 no changes found | |
95 adding changesets | |
96 adding manifests | |
97 adding file changes | |
98 added 0 changesets with 0 changes to 1 files | |
99 3 local changesets published | |
100 $ hg tracked | |
101 I path:inside | |
102 I path:wider/f | |
103 | |
104 Pull down the newly added upstream revision. | |
105 | |
106 $ hg pull | |
107 pulling from ssh://user@dummy/master | |
108 searching for changes | |
109 adding changesets | |
110 adding manifests | |
111 adding file changes | |
112 added 5 changesets with 2 changes to 2 files | |
113 new changesets *:* (glob) | |
114 (run 'hg update' to get a working copy) | |
115 $ hg update -r 'desc("add wider")' | |
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
117 $ cat wider/f | |
118 wider | |
119 | |
120 $ hg update -r 'desc("update inside")' | |
121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
122 $ cat wider/f | |
123 wider | |
124 $ cat inside/f | |
125 inside v2 | |
126 | |
127 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
128 7: update widest v4 | |
129 6: add outside2 | |
130 5: update inside | |
131 4: update widest v3 | |
132 3: add wider, update widest | |
133 2: add outside | |
134 1: add widest | |
135 0: add inside | |
136 | |
137 Check that widening with a newline fails | |
138 | |
139 $ hg tracked --addinclude 'widest | |
140 > ' | |
141 abort: newlines are not allowed in narrowspec paths | |
142 [255] | |
143 | |
144 widen the narrow spec to include the widest file | |
145 | |
146 $ hg tracked --addinclude widest | |
147 comparing with ssh://user@dummy/master | |
148 searching for changes | |
149 no changes found | |
150 adding changesets | |
151 adding manifests | |
152 adding file changes | |
153 added 0 changesets with 4 changes to 3 files | |
154 5 local changesets published | |
155 $ hg tracked | |
156 I path:inside | |
157 I path:wider/f | |
158 I path:widest | |
159 $ hg update 'desc("add widest")' | |
160 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
161 $ cat widest/f | |
162 widest | |
163 $ hg update 'desc("add wider, update widest")' | |
164 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
165 $ cat wider/f | |
166 wider | |
167 $ cat widest/f | |
168 widest v2 | |
169 $ hg update 'desc("update widest v3")' | |
170 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
171 $ cat widest/f | |
172 widest v3 | |
173 $ hg update 'desc("update widest v4")' | |
174 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
175 $ cat widest/f | |
176 widest v4 | |
177 | |
178 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
179 7: update widest v4 | |
180 6: add outside2 | |
181 5: update inside | |
182 4: update widest v3 | |
183 3: add wider, update widest | |
184 2: add outside | |
185 1: add widest | |
186 0: add inside | |
187 | |
188 separate suite of tests: files from 0-10 modified in changes 0-10. This allows | |
189 more obvious precise tests tickling particular corner cases. | |
190 | |
191 $ cd .. | |
192 $ hg init upstream | |
193 $ cd upstream | |
194 $ for x in `$TESTDIR/seq.py 0 10` | |
195 > do | |
196 > mkdir d$x | |
197 > echo $x > d$x/f | |
198 > hg add d$x/f | |
199 > hg commit -m "add d$x/f" | |
200 > done | |
201 $ hg log -T "{rev}: {desc}\n" | |
202 10: add d10/f | |
203 9: add d9/f | |
204 8: add d8/f | |
205 7: add d7/f | |
206 6: add d6/f | |
207 5: add d5/f | |
208 4: add d4/f | |
209 3: add d3/f | |
210 2: add d2/f | |
211 1: add d1/f | |
212 0: add d0/f | |
213 | |
214 make narrow clone with every third node. | |
215 | |
216 $ cd .. | |
217 $ hg clone --narrow ssh://user@dummy/upstream narrow2 --include d0 --include d3 --include d6 --include d9 | |
218 requesting all changes | |
219 adding changesets | |
220 adding manifests | |
221 adding file changes | |
222 added 11 changesets with 4 changes to 4 files | |
223 new changesets *:* (glob) | |
224 updating to branch default | |
225 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
226 $ cd narrow2 | |
227 $ hg tracked | |
228 I path:d0 | |
229 I path:d3 | |
230 I path:d6 | |
231 I path:d9 | |
232 $ hg verify | |
233 checking changesets | |
234 checking manifests | |
235 checking directory manifests (tree !) | |
236 crosschecking files in changesets and manifests | |
237 checking files | |
238 4 files, 11 changesets, 4 total revisions | |
239 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
240 10: add d10/f | |
241 9: add d9/f | |
242 8: add d8/f | |
243 7: add d7/f | |
244 6: add d6/f | |
245 5: add d5/f | |
246 4: add d4/f | |
247 3: add d3/f | |
248 2: add d2/f | |
249 1: add d1/f | |
250 0: add d0/f | |
251 $ hg tracked --addinclude d1 | |
252 comparing with ssh://user@dummy/upstream | |
253 searching for changes | |
254 no changes found | |
255 adding changesets | |
256 adding manifests | |
257 adding file changes | |
258 added 0 changesets with 1 changes to 5 files | |
259 11 local changesets published | |
260 $ hg tracked | |
261 I path:d0 | |
262 I path:d1 | |
263 I path:d3 | |
264 I path:d6 | |
265 I path:d9 | |
266 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
267 10: add d10/f | |
268 9: add d9/f | |
269 8: add d8/f | |
270 7: add d7/f | |
271 6: add d6/f | |
272 5: add d5/f | |
273 4: add d4/f | |
274 3: add d3/f | |
275 2: add d2/f | |
276 1: add d1/f | |
277 0: add d0/f | |
278 | |
279 Verify shouldn't claim the repo is corrupt after a widen. | |
280 | |
281 $ hg verify | |
282 checking changesets | |
283 checking manifests | |
284 checking directory manifests (tree !) | |
285 crosschecking files in changesets and manifests | |
286 checking files | |
287 5 files, 11 changesets, 5 total revisions | |
288 | |
289 Widening preserves parent of local commit | |
290 | |
291 $ cd .. | |
292 $ hg clone -q --narrow ssh://user@dummy/upstream narrow3 --include d2 -r 2 | |
293 $ cd narrow3 | |
294 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
295 2: add d2/f | |
296 1: add d1/f | |
297 0: add d0/f | |
298 $ hg pull -q -r 3 | |
299 $ hg co -q tip | |
300 $ hg pull -q -r 4 | |
301 $ echo local > d2/f | |
302 $ hg ci -m local | |
303 created new head | |
304 $ hg tracked -q --addinclude d0 --addinclude d9 | |
305 | |
306 Widening preserves bookmarks | |
307 | |
308 $ cd .. | |
309 $ hg clone -q --narrow ssh://user@dummy/upstream narrow-bookmarks --include d4 | |
310 $ cd narrow-bookmarks | |
311 $ echo local > d4/f | |
312 $ hg ci -m local | |
313 $ hg bookmarks bookmark | |
314 $ hg bookmarks | |
315 * bookmark 11:* (glob) | |
316 $ hg -q tracked --addinclude d2 | |
317 $ hg bookmarks | |
318 * bookmark 11:* (glob) | |
319 $ hg log -r bookmark -T '{desc}\n' | |
320 local | |
321 | |
322 Widening that fails can be recovered from | |
323 | |
324 $ cd .. | |
325 $ hg clone -q --narrow ssh://user@dummy/upstream interrupted --include d0 | |
326 $ cd interrupted | |
327 $ echo local > d0/f | |
328 $ hg ci -m local | |
329 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
330 11: local | |
331 10: add d10/f | |
332 9: add d9/f | |
333 8: add d8/f | |
334 7: add d7/f | |
335 6: add d6/f | |
336 5: add d5/f | |
337 4: add d4/f | |
338 3: add d3/f | |
339 2: add d2/f | |
340 1: add d1/f | |
341 0: add d0/f | |
342 $ hg bookmarks bookmark | |
343 $ hg --config hooks.pretxnchangegroup.bad=false tracked --addinclude d1 | |
344 comparing with ssh://user@dummy/upstream | |
345 searching for changes | |
346 no changes found | |
347 adding changesets | |
348 adding manifests | |
349 adding file changes | |
350 added 0 changesets with 1 changes to 2 files | |
351 11 local changesets published | |
352 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
353 11: local | |
354 10: add d10/f | |
355 9: add d9/f | |
356 8: add d8/f | |
357 7: add d7/f | |
358 6: add d6/f | |
359 5: add d5/f | |
360 4: add d4/f | |
361 3: add d3/f | |
362 2: add d2/f | |
363 1: add d1/f | |
364 0: add d0/f | |
365 $ hg bookmarks | |
366 * bookmark 11:* (glob) | |
367 $ hg unbundle .hg/strip-backup/*-widen.hg | |
368 abort: $ENOENT$: .hg/strip-backup/*-widen.hg | |
369 [255] | |
370 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n" | |
371 11: local | |
372 10: add d10/f | |
373 9: add d9/f | |
374 8: add d8/f | |
375 7: add d7/f | |
376 6: add d6/f | |
377 5: add d5/f | |
378 4: add d4/f | |
379 3: add d3/f | |
380 2: add d2/f | |
381 1: add d1/f | |
382 0: add d0/f | |
383 $ hg bookmarks | |
384 * bookmark 11:* (glob) |