Show More
@@ -1,897 +1,815 | |||
|
1 | 1 | $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80 |
|
2 | 2 | |
|
3 | 3 | $ USERCACHE=`pwd`/cache; export USERCACHE |
|
4 | 4 | $ mkdir -p ${USERCACHE} |
|
5 | 5 | $ cat >> $HGRCPATH <<EOF |
|
6 | 6 | > [extensions] |
|
7 | 7 | > largefiles= |
|
8 | 8 | > purge= |
|
9 | 9 | > rebase= |
|
10 | 10 | > transplant= |
|
11 | 11 | > [phases] |
|
12 | 12 | > publish=False |
|
13 | 13 | > [largefiles] |
|
14 | 14 | > minsize=2 |
|
15 | 15 | > patterns=glob:**.dat |
|
16 | 16 | > usercache=${USERCACHE} |
|
17 | 17 | > EOF |
|
18 | 18 | |
|
19 | 19 | Create the repo with a couple of revisions of both large and normal |
|
20 | 20 | files, testing that status correctly shows largefiles. |
|
21 | 21 | |
|
22 | 22 | $ hg init a |
|
23 | 23 | $ cd a |
|
24 | 24 | $ mkdir sub |
|
25 | 25 | $ echo normal1 > normal1 |
|
26 | 26 | $ echo normal2 > sub/normal2 |
|
27 | 27 | $ echo large1 > large1 |
|
28 | 28 | $ echo large2 > sub/large2 |
|
29 | 29 | $ hg add normal1 sub/normal2 |
|
30 | 30 | $ hg add --large large1 sub/large2 |
|
31 | 31 | $ hg commit -m "add files" |
|
32 | 32 | $ echo normal11 > normal1 |
|
33 | 33 | $ echo normal22 > sub/normal2 |
|
34 | 34 | $ echo large11 > large1 |
|
35 | 35 | $ echo large22 > sub/large2 |
|
36 | 36 | $ hg st |
|
37 | 37 | M large1 |
|
38 | 38 | M normal1 |
|
39 | 39 | M sub/large2 |
|
40 | 40 | M sub/normal2 |
|
41 | 41 | $ hg commit -m "edit files" |
|
42 | 42 | |
|
43 | 43 | Commit preserved largefile contents. |
|
44 | 44 | |
|
45 | 45 | $ cat normal1 |
|
46 | 46 | normal11 |
|
47 | 47 | $ cat large1 |
|
48 | 48 | large11 |
|
49 | 49 | $ cat sub/normal2 |
|
50 | 50 | normal22 |
|
51 | 51 | $ cat sub/large2 |
|
52 | 52 | large22 |
|
53 | 53 | |
|
54 | 54 | Remove both largefiles and normal files. |
|
55 | 55 | |
|
56 | 56 | $ hg remove normal1 large1 |
|
57 | 57 | $ hg commit -m "remove files" |
|
58 | 58 | $ ls |
|
59 | 59 | sub |
|
60 | 60 | |
|
61 | 61 | Copy both largefiles and normal files (testing that status output is correct). |
|
62 | 62 | |
|
63 | 63 | $ hg cp sub/normal2 normal1 |
|
64 | 64 | $ hg cp sub/large2 large1 |
|
65 | 65 | $ hg st |
|
66 | 66 | A large1 |
|
67 | 67 | A normal1 |
|
68 | 68 | $ hg commit -m "copy files" |
|
69 | 69 | $ cat normal1 |
|
70 | 70 | normal22 |
|
71 | 71 | $ cat large1 |
|
72 | 72 | large22 |
|
73 | 73 | |
|
74 | 74 | Test moving largefiles and verify that normal files are also unaffected. |
|
75 | 75 | |
|
76 | 76 | $ hg mv normal1 normal3 |
|
77 | 77 | $ hg mv large1 large3 |
|
78 | 78 | $ hg mv sub/normal2 sub/normal4 |
|
79 | 79 | $ hg mv sub/large2 sub/large4 |
|
80 | 80 | $ hg commit -m "move files" |
|
81 | 81 | $ cat normal3 |
|
82 | 82 | normal22 |
|
83 | 83 | $ cat large3 |
|
84 | 84 | large22 |
|
85 | 85 | $ cat sub/normal4 |
|
86 | 86 | normal22 |
|
87 | 87 | $ cat sub/large4 |
|
88 | 88 | large22 |
|
89 | 89 | |
|
90 | 90 | Test archiving the various revisions. These hit corner cases known with |
|
91 | 91 | archiving. |
|
92 | 92 | |
|
93 | 93 | $ hg archive -r 0 ../archive0 |
|
94 | 94 | $ hg archive -r 1 ../archive1 |
|
95 | 95 | $ hg archive -r 2 ../archive2 |
|
96 | 96 | $ hg archive -r 3 ../archive3 |
|
97 | 97 | $ hg archive -r 4 ../archive4 |
|
98 | 98 | $ cd ../archive0 |
|
99 | 99 | $ cat normal1 |
|
100 | 100 | normal1 |
|
101 | 101 | $ cat large1 |
|
102 | 102 | large1 |
|
103 | 103 | $ cat sub/normal2 |
|
104 | 104 | normal2 |
|
105 | 105 | $ cat sub/large2 |
|
106 | 106 | large2 |
|
107 | 107 | $ cd ../archive1 |
|
108 | 108 | $ cat normal1 |
|
109 | 109 | normal11 |
|
110 | 110 | $ cat large1 |
|
111 | 111 | large11 |
|
112 | 112 | $ cat sub/normal2 |
|
113 | 113 | normal22 |
|
114 | 114 | $ cat sub/large2 |
|
115 | 115 | large22 |
|
116 | 116 | $ cd ../archive2 |
|
117 | 117 | $ ls |
|
118 | 118 | sub |
|
119 | 119 | $ cat sub/normal2 |
|
120 | 120 | normal22 |
|
121 | 121 | $ cat sub/large2 |
|
122 | 122 | large22 |
|
123 | 123 | $ cd ../archive3 |
|
124 | 124 | $ cat normal1 |
|
125 | 125 | normal22 |
|
126 | 126 | $ cat large1 |
|
127 | 127 | large22 |
|
128 | 128 | $ cat sub/normal2 |
|
129 | 129 | normal22 |
|
130 | 130 | $ cat sub/large2 |
|
131 | 131 | large22 |
|
132 | 132 | $ cd ../archive4 |
|
133 | 133 | $ cat normal3 |
|
134 | 134 | normal22 |
|
135 | 135 | $ cat large3 |
|
136 | 136 | large22 |
|
137 | 137 | $ cat sub/normal4 |
|
138 | 138 | normal22 |
|
139 | 139 | $ cat sub/large4 |
|
140 | 140 | large22 |
|
141 | 141 | |
|
142 | 142 | Commit corner case: specify files to commit. |
|
143 | 143 | |
|
144 | 144 | $ cd ../a |
|
145 | 145 | $ echo normal3 > normal3 |
|
146 | 146 | $ echo large3 > large3 |
|
147 | 147 | $ echo normal4 > sub/normal4 |
|
148 | 148 | $ echo large4 > sub/large4 |
|
149 | 149 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" |
|
150 | 150 | $ cat normal3 |
|
151 | 151 | normal3 |
|
152 | 152 | $ cat large3 |
|
153 | 153 | large3 |
|
154 | 154 | $ cat sub/normal4 |
|
155 | 155 | normal4 |
|
156 | 156 | $ cat sub/large4 |
|
157 | 157 | large4 |
|
158 | 158 | |
|
159 | 159 | One more commit corner case: commit from a subdirectory. |
|
160 | 160 | |
|
161 | 161 | $ cd ../a |
|
162 | 162 | $ echo normal33 > normal3 |
|
163 | 163 | $ echo large33 > large3 |
|
164 | 164 | $ echo normal44 > sub/normal4 |
|
165 | 165 | $ echo large44 > sub/large4 |
|
166 | 166 | $ cd sub |
|
167 | 167 | $ hg commit -m "edit files yet again" |
|
168 | 168 | $ cat ../normal3 |
|
169 | 169 | normal33 |
|
170 | 170 | $ cat ../large3 |
|
171 | 171 | large33 |
|
172 | 172 | $ cat normal4 |
|
173 | 173 | normal44 |
|
174 | 174 | $ cat large4 |
|
175 | 175 | large44 |
|
176 | 176 | |
|
177 | 177 | Committing standins is not allowed. |
|
178 | 178 | |
|
179 | 179 | $ cd .. |
|
180 | 180 | $ echo large3 > large3 |
|
181 | 181 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
182 | 182 | abort: file ".hglf/large3" is a largefile standin |
|
183 | 183 | (commit the largefile itself instead) |
|
184 | 184 | [255] |
|
185 | 185 | |
|
186 | 186 | Corner cases for adding largefiles. |
|
187 | 187 | |
|
188 | 188 | $ echo large5 > large5 |
|
189 | 189 | $ hg add --large large5 |
|
190 | 190 | $ hg add --large large5 |
|
191 | 191 | large5 already a largefile |
|
192 | 192 | $ mkdir sub2 |
|
193 | 193 | $ echo large6 > sub2/large6 |
|
194 | 194 | $ echo large7 > sub2/large7 |
|
195 | 195 | $ hg add --large sub2 |
|
196 | 196 | adding sub2/large6 as a largefile (glob) |
|
197 | 197 | adding sub2/large7 as a largefile (glob) |
|
198 | 198 | $ hg st |
|
199 | 199 | M large3 |
|
200 | 200 | A large5 |
|
201 | 201 | A sub2/large6 |
|
202 | 202 | A sub2/large7 |
|
203 | 203 | |
|
204 | 204 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
205 | 205 | |
|
206 | 206 | $ echo testdata > test.dat |
|
207 | 207 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null |
|
208 | 208 | $ hg add |
|
209 | 209 | adding reallylarge as a largefile |
|
210 | 210 | adding test.dat as a largefile |
|
211 | 211 | |
|
212 | 212 | Test that minsize and --lfsize handle float values; |
|
213 | 213 | also tests that --lfsize overrides largefiles.minsize. |
|
214 | 214 | (0.250 MB = 256 kB = 262144 B) |
|
215 | 215 | |
|
216 | 216 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null |
|
217 | 217 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null |
|
218 | 218 | $ hg --config largefiles.minsize=.25 add |
|
219 | 219 | adding ratherlarge as a largefile |
|
220 | 220 | adding medium |
|
221 | 221 | $ hg forget medium |
|
222 | 222 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
223 | 223 | adding medium as a largefile |
|
224 | 224 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null |
|
225 | 225 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
226 | 226 | adding notlarge |
|
227 | 227 | $ hg forget notlarge |
|
228 | 228 | |
|
229 | 229 | Test forget on largefiles. |
|
230 | 230 | |
|
231 | 231 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
232 | 232 | $ hg st |
|
233 | 233 | A sub2/large6 |
|
234 | 234 | A sub2/large7 |
|
235 | 235 | R large3 |
|
236 | 236 | ? large5 |
|
237 | 237 | ? medium |
|
238 | 238 | ? notlarge |
|
239 | 239 | ? ratherlarge |
|
240 | 240 | ? reallylarge |
|
241 | 241 | ? test.dat |
|
242 | 242 | $ hg commit -m "add/edit more largefiles" |
|
243 | 243 | $ hg st |
|
244 | 244 | ? large3 |
|
245 | 245 | ? large5 |
|
246 | 246 | ? medium |
|
247 | 247 | ? notlarge |
|
248 | 248 | ? ratherlarge |
|
249 | 249 | ? reallylarge |
|
250 | 250 | ? test.dat |
|
251 | 251 | |
|
252 | 252 | Purge with largefiles: verify that largefiles are still in the working |
|
253 | 253 | dir after a purge. |
|
254 | 254 | |
|
255 | 255 | $ hg purge --all |
|
256 | 256 | $ cat sub/large4 |
|
257 | 257 | large44 |
|
258 | 258 | $ cat sub2/large6 |
|
259 | 259 | large6 |
|
260 | 260 | $ cat sub2/large7 |
|
261 | 261 | large7 |
|
262 | 262 | |
|
263 | 263 | Clone a largefiles repo. |
|
264 | 264 | |
|
265 | 265 | $ hg clone . ../b |
|
266 | 266 | updating to branch default |
|
267 | 267 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
268 | 268 | getting changed largefiles |
|
269 | 269 | 3 largefiles updated, 0 removed |
|
270 | 270 | $ cd ../b |
|
271 | 271 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
272 | 272 | 7:daea875e9014 add/edit more largefiles |
|
273 | 273 | 6:4355d653f84f edit files yet again |
|
274 | 274 | 5:9d5af5072dbd edit files again |
|
275 | 275 | 4:74c02385b94c move files |
|
276 | 276 | 3:9e8fbc4bce62 copy files |
|
277 | 277 | 2:51a0ae4d5864 remove files |
|
278 | 278 | 1:ce8896473775 edit files |
|
279 | 279 | 0:30d30fe6a5be add files |
|
280 | 280 | $ cat normal3 |
|
281 | 281 | normal33 |
|
282 | 282 | $ cat sub/normal4 |
|
283 | 283 | normal44 |
|
284 | 284 | $ cat sub/large4 |
|
285 | 285 | large44 |
|
286 | 286 | $ cat sub2/large6 |
|
287 | 287 | large6 |
|
288 | 288 | $ cat sub2/large7 |
|
289 | 289 | large7 |
|
290 | 290 | $ cd .. |
|
291 | 291 | $ hg clone a -r 3 c |
|
292 | 292 | adding changesets |
|
293 | 293 | adding manifests |
|
294 | 294 | adding file changes |
|
295 | 295 | added 4 changesets with 10 changes to 4 files |
|
296 | 296 | updating to branch default |
|
297 | 297 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
298 | 298 | getting changed largefiles |
|
299 | 299 | 2 largefiles updated, 0 removed |
|
300 | 300 | $ cd c |
|
301 | 301 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
302 | 302 | 3:9e8fbc4bce62 copy files |
|
303 | 303 | 2:51a0ae4d5864 remove files |
|
304 | 304 | 1:ce8896473775 edit files |
|
305 | 305 | 0:30d30fe6a5be add files |
|
306 | 306 | $ cat normal1 |
|
307 | 307 | normal22 |
|
308 | 308 | $ cat large1 |
|
309 | 309 | large22 |
|
310 | 310 | $ cat sub/normal2 |
|
311 | 311 | normal22 |
|
312 | 312 | $ cat sub/large2 |
|
313 | 313 | large22 |
|
314 | 314 | |
|
315 | 315 | Old revisions of a clone have correct largefiles content (this also |
|
316 | 316 | tests update). |
|
317 | 317 | |
|
318 | 318 | $ hg update -r 1 |
|
319 | 319 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
320 | 320 | getting changed largefiles |
|
321 | 321 | 1 largefiles updated, 0 removed |
|
322 | 322 | $ cat large1 |
|
323 | 323 | large11 |
|
324 | 324 | $ cat sub/large2 |
|
325 | 325 | large22 |
|
326 | 326 | |
|
327 | 327 | Rebasing between two repositories does not revert largefiles to old |
|
328 | 328 | revisions (this was a very bad bug that took a lot of work to fix). |
|
329 | 329 | |
|
330 | 330 | $ cd .. |
|
331 | 331 | $ hg clone a d |
|
332 | 332 | updating to branch default |
|
333 | 333 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
334 | 334 | getting changed largefiles |
|
335 | 335 | 3 largefiles updated, 0 removed |
|
336 | 336 | $ cd b |
|
337 | 337 | $ echo large4-modified > sub/large4 |
|
338 | 338 | $ echo normal3-modified > normal3 |
|
339 | 339 | $ hg commit -m "modify normal file and largefile in repo b" |
|
340 | 340 | $ cd ../d |
|
341 | 341 | $ echo large6-modified > sub2/large6 |
|
342 | 342 | $ echo normal4-modified > sub/normal4 |
|
343 | 343 | $ hg commit -m "modify normal file largefile in repo d" |
|
344 | 344 | $ cd .. |
|
345 | 345 | $ hg clone d e |
|
346 | 346 | updating to branch default |
|
347 | 347 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
348 | 348 | getting changed largefiles |
|
349 | 349 | 3 largefiles updated, 0 removed |
|
350 | 350 | $ cd d |
|
351 | 351 | $ hg pull --rebase ../b |
|
352 | 352 | pulling from ../b |
|
353 | 353 | searching for changes |
|
354 | 354 | adding changesets |
|
355 | 355 | adding manifests |
|
356 | 356 | adding file changes |
|
357 | 357 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
358 | 358 | getting changed largefiles |
|
359 | 359 | 1 largefiles updated, 0 removed |
|
360 | 360 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
361 | 361 | nothing to rebase |
|
362 | 362 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
363 | 363 | 9:598410d3eb9a modify normal file largefile in repo d |
|
364 | 364 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
365 | 365 | 7:daea875e9014 add/edit more largefiles |
|
366 | 366 | 6:4355d653f84f edit files yet again |
|
367 | 367 | 5:9d5af5072dbd edit files again |
|
368 | 368 | 4:74c02385b94c move files |
|
369 | 369 | 3:9e8fbc4bce62 copy files |
|
370 | 370 | 2:51a0ae4d5864 remove files |
|
371 | 371 | 1:ce8896473775 edit files |
|
372 | 372 | 0:30d30fe6a5be add files |
|
373 | 373 | $ cat normal3 |
|
374 | 374 | normal3-modified |
|
375 | 375 | $ cat sub/normal4 |
|
376 | 376 | normal4-modified |
|
377 | 377 | $ cat sub/large4 |
|
378 | 378 | large4-modified |
|
379 | 379 | $ cat sub2/large6 |
|
380 | 380 | large6-modified |
|
381 | 381 | $ cat sub2/large7 |
|
382 | 382 | large7 |
|
383 | 383 | $ cd ../e |
|
384 | 384 | $ hg pull ../b |
|
385 | 385 | pulling from ../b |
|
386 | 386 | searching for changes |
|
387 | 387 | adding changesets |
|
388 | 388 | adding manifests |
|
389 | 389 | adding file changes |
|
390 | 390 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
391 | 391 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
392 | 392 | $ hg rebase |
|
393 | 393 | getting changed largefiles |
|
394 | 394 | 1 largefiles updated, 0 removed |
|
395 | 395 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
396 | $ hg log | |
|
397 | changeset: 9:598410d3eb9a | |
|
398 | tag: tip | |
|
399 | user: test | |
|
400 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
401 | summary: modify normal file largefile in repo d | |
|
402 | ||
|
403 | changeset: 8:a381d2c8c80e | |
|
404 | user: test | |
|
405 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
406 | summary: modify normal file and largefile in repo b | |
|
407 | ||
|
408 | changeset: 7:daea875e9014 | |
|
409 | user: test | |
|
410 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
411 | summary: add/edit more largefiles | |
|
412 | ||
|
413 | changeset: 6:4355d653f84f | |
|
414 | user: test | |
|
415 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
416 | summary: edit files yet again | |
|
417 | ||
|
418 | changeset: 5:9d5af5072dbd | |
|
419 | user: test | |
|
420 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
421 | summary: edit files again | |
|
422 | ||
|
423 | changeset: 4:74c02385b94c | |
|
424 | user: test | |
|
425 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
426 | summary: move files | |
|
427 | ||
|
428 | changeset: 3:9e8fbc4bce62 | |
|
429 | user: test | |
|
430 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
431 | summary: copy files | |
|
432 | ||
|
433 | changeset: 2:51a0ae4d5864 | |
|
434 | user: test | |
|
435 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
436 | summary: remove files | |
|
437 | ||
|
438 | changeset: 1:ce8896473775 | |
|
439 | user: test | |
|
440 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
441 | summary: edit files | |
|
442 | ||
|
443 | changeset: 0:30d30fe6a5be | |
|
444 | user: test | |
|
445 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
446 | summary: add files | |
|
447 | ||
|
396 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
|
397 | 9:598410d3eb9a modify normal file largefile in repo d | |
|
398 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
|
399 | 7:daea875e9014 add/edit more largefiles | |
|
400 | 6:4355d653f84f edit files yet again | |
|
401 | 5:9d5af5072dbd edit files again | |
|
402 | 4:74c02385b94c move files | |
|
403 | 3:9e8fbc4bce62 copy files | |
|
404 | 2:51a0ae4d5864 remove files | |
|
405 | 1:ce8896473775 edit files | |
|
406 | 0:30d30fe6a5be add files | |
|
448 | 407 | $ cat normal3 |
|
449 | 408 | normal3-modified |
|
450 | 409 | $ cat sub/normal4 |
|
451 | 410 | normal4-modified |
|
452 | 411 | $ cat sub/large4 |
|
453 | 412 | large4-modified |
|
454 | 413 | $ cat sub2/large6 |
|
455 | 414 | large6-modified |
|
456 | 415 | $ cat sub2/large7 |
|
457 | 416 | large7 |
|
458 | 417 | |
|
459 | 418 | Rollback on largefiles. |
|
460 | 419 | |
|
461 | 420 | $ echo large4-modified-again > sub/large4 |
|
462 | 421 | $ hg commit -m "Modify large4 again" |
|
463 | 422 | $ hg rollback |
|
464 | 423 | repository tip rolled back to revision 9 (undo commit) |
|
465 | 424 | working directory now based on revision 9 |
|
466 | 425 | $ hg st |
|
467 | 426 | M sub/large4 |
|
468 | $ hg log | |
|
469 | changeset: 9:598410d3eb9a | |
|
470 | tag: tip | |
|
471 | user: test | |
|
472 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
473 | summary: modify normal file largefile in repo d | |
|
474 | ||
|
475 | changeset: 8:a381d2c8c80e | |
|
476 | user: test | |
|
477 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
478 | summary: modify normal file and largefile in repo b | |
|
479 | ||
|
480 | changeset: 7:daea875e9014 | |
|
481 | user: test | |
|
482 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
483 | summary: add/edit more largefiles | |
|
484 | ||
|
485 | changeset: 6:4355d653f84f | |
|
486 | user: test | |
|
487 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
488 | summary: edit files yet again | |
|
489 | ||
|
490 | changeset: 5:9d5af5072dbd | |
|
491 | user: test | |
|
492 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
493 | summary: edit files again | |
|
494 | ||
|
495 | changeset: 4:74c02385b94c | |
|
496 | user: test | |
|
497 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
498 | summary: move files | |
|
499 | ||
|
500 | changeset: 3:9e8fbc4bce62 | |
|
501 | user: test | |
|
502 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
503 | summary: copy files | |
|
504 | ||
|
505 | changeset: 2:51a0ae4d5864 | |
|
506 | user: test | |
|
507 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
508 | summary: remove files | |
|
509 | ||
|
510 | changeset: 1:ce8896473775 | |
|
511 | user: test | |
|
512 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
513 | summary: edit files | |
|
514 | ||
|
515 | changeset: 0:30d30fe6a5be | |
|
516 | user: test | |
|
517 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
518 | summary: add files | |
|
519 | ||
|
427 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
|
428 | 9:598410d3eb9a modify normal file largefile in repo d | |
|
429 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
|
430 | 7:daea875e9014 add/edit more largefiles | |
|
431 | 6:4355d653f84f edit files yet again | |
|
432 | 5:9d5af5072dbd edit files again | |
|
433 | 4:74c02385b94c move files | |
|
434 | 3:9e8fbc4bce62 copy files | |
|
435 | 2:51a0ae4d5864 remove files | |
|
436 | 1:ce8896473775 edit files | |
|
437 | 0:30d30fe6a5be add files | |
|
520 | 438 | $ cat sub/large4 |
|
521 | 439 | large4-modified-again |
|
522 | 440 | |
|
523 | 441 | "update --check" refuses to update with uncommitted changes. |
|
524 | 442 | $ hg update --check 8 |
|
525 | 443 | abort: uncommitted local changes |
|
526 | 444 | [255] |
|
527 | 445 | |
|
528 | 446 | "update --clean" leaves correct largefiles in working copy. |
|
529 | 447 | |
|
530 | 448 | $ hg update --clean |
|
531 | 449 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
532 | 450 | getting changed largefiles |
|
533 | 451 | 1 largefiles updated, 0 removed |
|
534 | 452 | $ cat normal3 |
|
535 | 453 | normal3-modified |
|
536 | 454 | $ cat sub/normal4 |
|
537 | 455 | normal4-modified |
|
538 | 456 | $ cat sub/large4 |
|
539 | 457 | large4-modified |
|
540 | 458 | $ cat sub2/large6 |
|
541 | 459 | large6-modified |
|
542 | 460 | $ cat sub2/large7 |
|
543 | 461 | large7 |
|
544 | 462 | |
|
545 | 463 | Now "update check" is happy. |
|
546 | 464 | $ hg update --check 8 |
|
547 | 465 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
548 | 466 | getting changed largefiles |
|
549 | 467 | 1 largefiles updated, 0 removed |
|
550 | 468 | $ hg update --check |
|
551 | 469 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
552 | 470 | getting changed largefiles |
|
553 | 471 | 1 largefiles updated, 0 removed |
|
554 | 472 | |
|
555 | 473 | "revert" works on largefiles (and normal files too). |
|
556 | 474 | $ echo hack3 >> normal3 |
|
557 | 475 | $ echo hack4 >> sub/normal4 |
|
558 | 476 | $ echo hack4 >> sub/large4 |
|
559 | 477 | $ hg rm sub2/large6 |
|
560 | 478 | $ echo new >> sub2/large8 |
|
561 | 479 | $ hg add --large sub2/large8 |
|
562 | 480 | # XXX we don't really want to report that we're reverting the standin; |
|
563 | 481 | # that's just an implementation detail. But I don't see an obvious fix. ;-( |
|
564 | 482 | $ hg revert sub |
|
565 | 483 | reverting .hglf/sub/large4 (glob) |
|
566 | 484 | reverting sub/normal4 (glob) |
|
567 | 485 | $ hg status |
|
568 | 486 | M normal3 |
|
569 | 487 | A sub2/large8 |
|
570 | 488 | R sub2/large6 |
|
571 | 489 | ? sub/large4.orig |
|
572 | 490 | ? sub/normal4.orig |
|
573 | 491 | $ cat sub/normal4 |
|
574 | 492 | normal4-modified |
|
575 | 493 | $ cat sub/large4 |
|
576 | 494 | large4-modified |
|
577 | 495 | $ hg revert -a --no-backup |
|
578 | 496 | undeleting .hglf/sub2/large6 (glob) |
|
579 | 497 | forgetting .hglf/sub2/large8 (glob) |
|
580 | 498 | reverting normal3 |
|
581 | 499 | $ hg status |
|
582 | 500 | ? sub/large4.orig |
|
583 | 501 | ? sub/normal4.orig |
|
584 | 502 | ? sub2/large8 |
|
585 | 503 | $ cat normal3 |
|
586 | 504 | normal3-modified |
|
587 | 505 | $ cat sub2/large6 |
|
588 | 506 | large6-modified |
|
589 | 507 | $ rm sub/*.orig sub2/large8 |
|
590 | 508 | |
|
591 | 509 | revert some files to an older revision |
|
592 | 510 | $ hg revert --no-backup -r 8 sub2 |
|
593 | 511 | reverting .hglf/sub2/large6 (glob) |
|
594 | 512 | $ cat sub2/large6 |
|
595 | 513 | large6 |
|
596 | 514 | $ hg revert --no-backup sub2 |
|
597 | 515 | reverting .hglf/sub2/large6 (glob) |
|
598 | 516 | $ hg status |
|
599 | 517 | |
|
600 | 518 | "verify --large" actually verifies largefiles |
|
601 | 519 | |
|
602 | 520 | $ hg verify --large |
|
603 | 521 | checking changesets |
|
604 | 522 | checking manifests |
|
605 | 523 | crosschecking files in changesets and manifests |
|
606 | 524 | checking files |
|
607 | 525 | 10 files, 10 changesets, 28 total revisions |
|
608 | 526 | searching 1 changesets for largefiles |
|
609 | 527 | verified existence of 3 revisions of 3 largefiles |
|
610 | 528 | |
|
611 | 529 | Merging does not revert to old versions of largefiles (this has also |
|
612 | 530 | been very problematic). |
|
613 | 531 | |
|
614 | 532 | $ cd .. |
|
615 | 533 | $ hg clone -r 7 e f |
|
616 | 534 | adding changesets |
|
617 | 535 | adding manifests |
|
618 | 536 | adding file changes |
|
619 | 537 | added 8 changesets with 24 changes to 10 files |
|
620 | 538 | updating to branch default |
|
621 | 539 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
622 | 540 | getting changed largefiles |
|
623 | 541 | 3 largefiles updated, 0 removed |
|
624 | 542 | $ cd f |
|
625 | 543 | $ echo "large4-merge-test" > sub/large4 |
|
626 | 544 | $ hg commit -m "Modify large4 to test merge" |
|
627 | 545 | $ hg pull ../e |
|
628 | 546 | pulling from ../e |
|
629 | 547 | searching for changes |
|
630 | 548 | adding changesets |
|
631 | 549 | adding manifests |
|
632 | 550 | adding file changes |
|
633 | 551 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
634 | 552 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
635 | 553 | $ hg merge |
|
636 | 554 | merging sub/large4 |
|
637 | 555 | largefile sub/large4 has a merge conflict |
|
638 | 556 | keep (l)ocal or take (o)ther? l |
|
639 | 557 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
640 | 558 | (branch merge, don't forget to commit) |
|
641 | 559 | getting changed largefiles |
|
642 | 560 | 1 largefiles updated, 0 removed |
|
643 | 561 | $ hg commit -m "Merge repos e and f" |
|
644 | 562 | $ cat normal3 |
|
645 | 563 | normal3-modified |
|
646 | 564 | $ cat sub/normal4 |
|
647 | 565 | normal4-modified |
|
648 | 566 | $ cat sub/large4 |
|
649 | 567 | large4-merge-test |
|
650 | 568 | $ cat sub2/large6 |
|
651 | 569 | large6-modified |
|
652 | 570 | $ cat sub2/large7 |
|
653 | 571 | large7 |
|
654 | 572 | |
|
655 | 573 | Test status after merging with a branch that introduces a new largefile: |
|
656 | 574 | |
|
657 | 575 | $ echo large > large |
|
658 | 576 | $ hg add --large large |
|
659 | 577 | $ hg commit -m 'add largefile' |
|
660 | 578 | $ hg update -q ".^" |
|
661 | 579 | $ echo change >> normal3 |
|
662 | 580 | $ hg commit -m 'some change' |
|
663 | 581 | created new head |
|
664 | 582 | $ hg merge |
|
665 | 583 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
666 | 584 | (branch merge, don't forget to commit) |
|
667 | 585 | getting changed largefiles |
|
668 | 586 | 1 largefiles updated, 0 removed |
|
669 | 587 | $ hg status |
|
670 | 588 | M large |
|
671 | 589 | |
|
672 | 590 | Test that a normal file and a largefile with the same name and path cannot |
|
673 | 591 | coexist. |
|
674 | 592 | |
|
675 | 593 | $ rm sub2/large7 |
|
676 | 594 | $ echo "largeasnormal" > sub2/large7 |
|
677 | 595 | $ hg add sub2/large7 |
|
678 | 596 | sub2/large7 already a largefile |
|
679 | 597 | |
|
680 | 598 | Test that transplanting a largefile change works correctly. |
|
681 | 599 | |
|
682 | 600 | $ cd .. |
|
683 | 601 | $ hg clone -r 8 d g |
|
684 | 602 | adding changesets |
|
685 | 603 | adding manifests |
|
686 | 604 | adding file changes |
|
687 | 605 | added 9 changesets with 26 changes to 10 files |
|
688 | 606 | updating to branch default |
|
689 | 607 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
690 | 608 | getting changed largefiles |
|
691 | 609 | 3 largefiles updated, 0 removed |
|
692 | 610 | $ cd g |
|
693 | 611 | $ hg transplant -s ../d 598410d3eb9a |
|
694 | 612 | searching for changes |
|
695 | 613 | searching for changes |
|
696 | 614 | adding changesets |
|
697 | 615 | adding manifests |
|
698 | 616 | adding file changes |
|
699 | 617 | added 1 changesets with 2 changes to 2 files |
|
700 | 618 | getting changed largefiles |
|
701 | 619 | 1 largefiles updated, 0 removed |
|
702 | 620 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
703 | 621 | 9:598410d3eb9a modify normal file largefile in repo d |
|
704 | 622 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
705 | 623 | 7:daea875e9014 add/edit more largefiles |
|
706 | 624 | 6:4355d653f84f edit files yet again |
|
707 | 625 | 5:9d5af5072dbd edit files again |
|
708 | 626 | 4:74c02385b94c move files |
|
709 | 627 | 3:9e8fbc4bce62 copy files |
|
710 | 628 | 2:51a0ae4d5864 remove files |
|
711 | 629 | 1:ce8896473775 edit files |
|
712 | 630 | 0:30d30fe6a5be add files |
|
713 | 631 | $ cat normal3 |
|
714 | 632 | normal3-modified |
|
715 | 633 | $ cat sub/normal4 |
|
716 | 634 | normal4-modified |
|
717 | 635 | $ cat sub/large4 |
|
718 | 636 | large4-modified |
|
719 | 637 | $ cat sub2/large6 |
|
720 | 638 | large6-modified |
|
721 | 639 | $ cat sub2/large7 |
|
722 | 640 | large7 |
|
723 | 641 | |
|
724 | 642 | Test that renaming a largefile results in correct output for status |
|
725 | 643 | |
|
726 | 644 | $ hg rename sub/large4 large4-renamed |
|
727 | 645 | $ hg st |
|
728 | 646 | A large4-renamed |
|
729 | 647 | R sub/large4 |
|
730 | 648 | $ hg commit -m "test rename output" |
|
731 | 649 | $ cat large4-renamed |
|
732 | 650 | large4-modified |
|
733 | 651 | $ cd sub2 |
|
734 | 652 | $ hg rename large6 large6-renamed |
|
735 | 653 | $ hg st |
|
736 | 654 | A sub2/large6-renamed |
|
737 | 655 | R sub2/large6 |
|
738 | 656 | $ cd ../.. |
|
739 | 657 | |
|
740 | 658 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
741 | 659 | $ mkdir r1 |
|
742 | 660 | $ cd r1 |
|
743 | 661 | $ hg init |
|
744 | 662 | $ echo c1 > f1 |
|
745 | 663 | $ hg add f1 |
|
746 | 664 | $ hg com -m "m1" |
|
747 | 665 | $ cd .. |
|
748 | 666 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
749 | 667 | $ cat hg.pid >> $DAEMON_PIDS |
|
750 | 668 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
751 | 669 | requesting all changes |
|
752 | 670 | adding changesets |
|
753 | 671 | adding manifests |
|
754 | 672 | adding file changes |
|
755 | 673 | added 1 changesets with 1 changes to 1 files |
|
756 | 674 | updating to branch default |
|
757 | 675 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
758 | 676 | |
|
759 | 677 | largefiles clients still work with vanilla servers |
|
760 | 678 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
761 | 679 | $ cat hg.pid >> $DAEMON_PIDS |
|
762 | 680 | $ hg clone http://localhost:$HGPORT1 r3 |
|
763 | 681 | requesting all changes |
|
764 | 682 | adding changesets |
|
765 | 683 | adding manifests |
|
766 | 684 | adding file changes |
|
767 | 685 | added 1 changesets with 1 changes to 1 files |
|
768 | 686 | updating to branch default |
|
769 | 687 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
770 | 688 | |
|
771 | 689 | vanilla clients locked out from largefiles http repos |
|
772 | 690 | $ mkdir r4 |
|
773 | 691 | $ cd r4 |
|
774 | 692 | $ hg init |
|
775 | 693 | $ echo c1 > f1 |
|
776 | 694 | $ hg add --large f1 |
|
777 | 695 | $ hg com -m "m1" |
|
778 | 696 | $ cd .. |
|
779 | 697 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
780 | 698 | $ cat hg.pid >> $DAEMON_PIDS |
|
781 | 699 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
782 | 700 | abort: remote error: |
|
783 | 701 | |
|
784 | 702 | This repository uses the largefiles extension. |
|
785 | 703 | |
|
786 | 704 | Please enable it in your Mercurial config file. |
|
787 | 705 | [255] |
|
788 | 706 | |
|
789 | 707 | used all HGPORTs, kill all daemons |
|
790 | 708 | $ "$TESTDIR/killdaemons.py" |
|
791 | 709 | |
|
792 | 710 | vanilla clients locked out from largefiles ssh repos |
|
793 | 711 | $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5 |
|
794 | 712 | abort: remote error: |
|
795 | 713 | |
|
796 | 714 | This repository uses the largefiles extension. |
|
797 | 715 | |
|
798 | 716 | Please enable it in your Mercurial config file. |
|
799 | 717 | [255] |
|
800 | 718 | |
|
801 | 719 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
802 | 720 | $ mkdir r6 |
|
803 | 721 | $ cd r6 |
|
804 | 722 | $ hg init |
|
805 | 723 | $ echo c1 > f1 |
|
806 | 724 | $ hg add f1 |
|
807 | 725 | $ hg com -m "m1" |
|
808 | 726 | $ cat >> .hg/hgrc <<! |
|
809 | 727 | > [web] |
|
810 | 728 | > push_ssl = false |
|
811 | 729 | > allow_push = * |
|
812 | 730 | > ! |
|
813 | 731 | $ cd .. |
|
814 | 732 | $ hg clone r6 r7 |
|
815 | 733 | updating to branch default |
|
816 | 734 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
817 | 735 | $ cd r7 |
|
818 | 736 | $ echo c2 > f2 |
|
819 | 737 | $ hg add --large f2 |
|
820 | 738 | $ hg com -m "m2" |
|
821 | 739 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid |
|
822 | 740 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
823 | 741 | $ hg push http://localhost:$HGPORT |
|
824 | 742 | pushing to http://localhost:$HGPORT/ |
|
825 | 743 | searching for changes |
|
826 | 744 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
827 | 745 | [255] |
|
828 | 746 | $ cd .. |
|
829 | 747 | |
|
830 | 748 | putlfile errors are shown (issue3123) |
|
831 | 749 | Corrupt the cached largefile in r7 |
|
832 | 750 | $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
833 | 751 | $ hg init empty |
|
834 | 752 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ |
|
835 | 753 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
836 | 754 | $ cat hg.pid >> $DAEMON_PIDS |
|
837 | 755 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
838 | 756 | pushing to http://localhost:$HGPORT1/ |
|
839 | 757 | searching for changes |
|
840 | 758 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash |
|
841 | 759 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ |
|
842 | 760 | [255] |
|
843 | 761 | $ rm -rf empty |
|
844 | 762 | |
|
845 | 763 | Clone a local repository owned by another user |
|
846 | 764 | We have to simulate that here by setting $HOME and removing write permissions |
|
847 | 765 | $ ORIGHOME="$HOME" |
|
848 | 766 | $ mkdir alice |
|
849 | 767 | $ HOME="`pwd`/alice" |
|
850 | 768 | $ cd alice |
|
851 | 769 | $ hg init pubrepo |
|
852 | 770 | $ cd pubrepo |
|
853 | 771 | $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null |
|
854 | 772 | $ hg add --large a-large-file |
|
855 | 773 | $ hg commit -m "Add a large file" |
|
856 | 774 | $ cd .. |
|
857 | 775 | $ chmod -R a-w pubrepo |
|
858 | 776 | $ cd .. |
|
859 | 777 | $ mkdir bob |
|
860 | 778 | $ HOME="`pwd`/bob" |
|
861 | 779 | $ cd bob |
|
862 | 780 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
863 | 781 | requesting all changes |
|
864 | 782 | adding changesets |
|
865 | 783 | adding manifests |
|
866 | 784 | adding file changes |
|
867 | 785 | added 1 changesets with 1 changes to 1 files |
|
868 | 786 | updating to branch default |
|
869 | 787 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
870 | 788 | getting changed largefiles |
|
871 | 789 | 1 largefiles updated, 0 removed |
|
872 | 790 | $ cd .. |
|
873 | 791 | $ chmod -R u+w alice/pubrepo |
|
874 | 792 | $ HOME="$ORIGHOME" |
|
875 | 793 | |
|
876 | 794 | Symlink to a large largefile should behave the same as a symlink to a normal file |
|
877 | 795 | $ hg init largesymlink |
|
878 | 796 | $ cd largesymlink |
|
879 | 797 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null |
|
880 | 798 | $ hg add --large largefile |
|
881 | 799 | $ hg commit -m "commit a large file" |
|
882 | 800 | $ ln -s largefile largelink |
|
883 | 801 | $ hg add largelink |
|
884 | 802 | $ hg commit -m "commit a large symlink" |
|
885 | 803 | $ rm -f largelink |
|
886 | 804 | $ hg up >/dev/null |
|
887 | 805 | $ test -f largelink |
|
888 | 806 | [1] |
|
889 | 807 | $ test -L largelink |
|
890 | 808 | [1] |
|
891 | 809 | $ rm -f largelink # make next part of the test independent of the previous |
|
892 | 810 | $ hg up -C >/dev/null |
|
893 | 811 | $ test -f largelink |
|
894 | 812 | $ test -L largelink |
|
895 | 813 | $ cd .. |
|
896 | 814 | |
|
897 | 815 |
General Comments 0
You need to be logged in to leave comments.
Login now