##// END OF EJS Templates
test-largefiles: fix test failing on vfat file systems...
Adrian Buehlmann -
r17234:0cfece81 stable
parent child Browse files
Show More
@@ -1,1373 +1,1374 b''
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
2 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles=
5 > largefiles=
6 > purge=
6 > purge=
7 > rebase=
7 > rebase=
8 > transplant=
8 > transplant=
9 > [phases]
9 > [phases]
10 > publish=False
10 > publish=False
11 > [largefiles]
11 > [largefiles]
12 > minsize=2
12 > minsize=2
13 > patterns=glob:**.dat
13 > patterns=glob:**.dat
14 > usercache=${USERCACHE}
14 > usercache=${USERCACHE}
15 > [hooks]
15 > [hooks]
16 > precommit=sh -c "echo \"Invoking status precommit hook\"; hg status"
16 > precommit=sh -c "echo \"Invoking status precommit hook\"; hg status"
17 > EOF
17 > EOF
18
18
19 Create the repo with a couple of revisions of both large and normal
19 Create the repo with a couple of revisions of both large and normal
20 files, testing that status correctly shows largefiles and that summary output
20 files, testing that status correctly shows largefiles and that summary output
21 is correct.
21 is correct.
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25 $ mkdir sub
25 $ mkdir sub
26 $ echo normal1 > normal1
26 $ echo normal1 > normal1
27 $ echo normal2 > sub/normal2
27 $ echo normal2 > sub/normal2
28 $ echo large1 > large1
28 $ echo large1 > large1
29 $ echo large2 > sub/large2
29 $ echo large2 > sub/large2
30 $ hg add normal1 sub/normal2
30 $ hg add normal1 sub/normal2
31 $ hg add --large large1 sub/large2
31 $ hg add --large large1 sub/large2
32 $ hg commit -m "add files"
32 $ hg commit -m "add files"
33 Invoking status precommit hook
33 Invoking status precommit hook
34 A large1
34 A large1
35 A normal1
35 A normal1
36 A sub/large2
36 A sub/large2
37 A sub/normal2
37 A sub/normal2
38 $ echo normal11 > normal1
38 $ echo normal11 > normal1
39 $ echo normal22 > sub/normal2
39 $ echo normal22 > sub/normal2
40 $ echo large11 > large1
40 $ echo large11 > large1
41 $ echo large22 > sub/large2
41 $ echo large22 > sub/large2
42 $ hg commit -m "edit files"
42 $ hg commit -m "edit files"
43 Invoking status precommit hook
43 Invoking status precommit hook
44 M large1
44 M large1
45 M normal1
45 M normal1
46 M sub/large2
46 M sub/large2
47 M sub/normal2
47 M sub/normal2
48 $ hg sum --large
48 $ hg sum --large
49 parent: 1:ce8896473775 tip
49 parent: 1:ce8896473775 tip
50 edit files
50 edit files
51 branch: default
51 branch: default
52 commit: (clean)
52 commit: (clean)
53 update: (current)
53 update: (current)
54 largefiles: No remote repo
54 largefiles: No remote repo
55
55
56 Commit preserved largefile contents.
56 Commit preserved largefile contents.
57
57
58 $ cat normal1
58 $ cat normal1
59 normal11
59 normal11
60 $ cat large1
60 $ cat large1
61 large11
61 large11
62 $ cat sub/normal2
62 $ cat sub/normal2
63 normal22
63 normal22
64 $ cat sub/large2
64 $ cat sub/large2
65 large22
65 large22
66
66
67 Test status, subdir and unknown files
67 Test status, subdir and unknown files
68
68
69 $ echo unknown > sub/unknown
69 $ echo unknown > sub/unknown
70 $ hg st --all
70 $ hg st --all
71 ? sub/unknown
71 ? sub/unknown
72 C large1
72 C large1
73 C normal1
73 C normal1
74 C sub/large2
74 C sub/large2
75 C sub/normal2
75 C sub/normal2
76 $ hg st --all sub
76 $ hg st --all sub
77 ? sub/unknown
77 ? sub/unknown
78 C sub/large2
78 C sub/large2
79 C sub/normal2
79 C sub/normal2
80 $ rm sub/unknown
80 $ rm sub/unknown
81
81
82 Remove both largefiles and normal files.
82 Remove both largefiles and normal files.
83
83
84 $ hg remove normal1 large1
84 $ hg remove normal1 large1
85 $ hg status large1
85 $ hg status large1
86 R large1
86 R large1
87 $ hg commit -m "remove files"
87 $ hg commit -m "remove files"
88 Invoking status precommit hook
88 Invoking status precommit hook
89 R large1
89 R large1
90 R normal1
90 R normal1
91 $ ls
91 $ ls
92 sub
92 sub
93 $ echo "testlargefile" > large1-test
93 $ echo "testlargefile" > large1-test
94 $ hg add --large large1-test
94 $ hg add --large large1-test
95 $ hg st
95 $ hg st
96 A large1-test
96 A large1-test
97 $ hg rm large1-test
97 $ hg rm large1-test
98 not removing large1-test: file has been marked for add (use forget to undo)
98 not removing large1-test: file has been marked for add (use forget to undo)
99 $ hg st
99 $ hg st
100 A large1-test
100 A large1-test
101 $ hg forget large1-test
101 $ hg forget large1-test
102 $ hg st
102 $ hg st
103 ? large1-test
103 ? large1-test
104 $ rm large1-test
104 $ rm large1-test
105
105
106 Copy both largefiles and normal files (testing that status output is correct).
106 Copy both largefiles and normal files (testing that status output is correct).
107
107
108 $ hg cp sub/normal2 normal1
108 $ hg cp sub/normal2 normal1
109 $ hg cp sub/large2 large1
109 $ hg cp sub/large2 large1
110 $ hg commit -m "copy files"
110 $ hg commit -m "copy files"
111 Invoking status precommit hook
111 Invoking status precommit hook
112 A large1
112 A large1
113 A normal1
113 A normal1
114 $ cat normal1
114 $ cat normal1
115 normal22
115 normal22
116 $ cat large1
116 $ cat large1
117 large22
117 large22
118
118
119 Test moving largefiles and verify that normal files are also unaffected.
119 Test moving largefiles and verify that normal files are also unaffected.
120
120
121 $ hg mv normal1 normal3
121 $ hg mv normal1 normal3
122 $ hg mv large1 large3
122 $ hg mv large1 large3
123 $ hg mv sub/normal2 sub/normal4
123 $ hg mv sub/normal2 sub/normal4
124 $ hg mv sub/large2 sub/large4
124 $ hg mv sub/large2 sub/large4
125 $ hg commit -m "move files"
125 $ hg commit -m "move files"
126 Invoking status precommit hook
126 Invoking status precommit hook
127 A large3
127 A large3
128 A normal3
128 A normal3
129 A sub/large4
129 A sub/large4
130 A sub/normal4
130 A sub/normal4
131 R large1
131 R large1
132 R normal1
132 R normal1
133 R sub/large2
133 R sub/large2
134 R sub/normal2
134 R sub/normal2
135 $ cat normal3
135 $ cat normal3
136 normal22
136 normal22
137 $ cat large3
137 $ cat large3
138 large22
138 large22
139 $ cat sub/normal4
139 $ cat sub/normal4
140 normal22
140 normal22
141 $ cat sub/large4
141 $ cat sub/large4
142 large22
142 large22
143
143
144 #if hgweb
144 #if hgweb
145 Test display of largefiles in hgweb
145 Test display of largefiles in hgweb
146
146
147 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
147 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
148 $ cat ../hg.pid >> $DAEMON_PIDS
148 $ cat ../hg.pid >> $DAEMON_PIDS
149 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
149 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
150 200 Script output follows
150 200 Script output follows
151
151
152
152
153 drwxr-xr-x sub
153 drwxr-xr-x sub
154 -rw-r--r-- 41 large3
154 -rw-r--r-- 41 large3
155 -rw-r--r-- 9 normal3
155 -rw-r--r-- 9 normal3
156
156
157
157
158 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
158 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
159 200 Script output follows
159 200 Script output follows
160
160
161
161
162 -rw-r--r-- 41 large4
162 -rw-r--r-- 41 large4
163 -rw-r--r-- 9 normal4
163 -rw-r--r-- 9 normal4
164
164
165
165
166 $ "$TESTDIR/killdaemons.py"
166 $ "$TESTDIR/killdaemons.py"
167 #endif
167 #endif
168
168
169 Test archiving the various revisions. These hit corner cases known with
169 Test archiving the various revisions. These hit corner cases known with
170 archiving.
170 archiving.
171
171
172 $ hg archive -r 0 ../archive0
172 $ hg archive -r 0 ../archive0
173 $ hg archive -r 1 ../archive1
173 $ hg archive -r 1 ../archive1
174 $ hg archive -r 2 ../archive2
174 $ hg archive -r 2 ../archive2
175 $ hg archive -r 3 ../archive3
175 $ hg archive -r 3 ../archive3
176 $ hg archive -r 4 ../archive4
176 $ hg archive -r 4 ../archive4
177 $ cd ../archive0
177 $ cd ../archive0
178 $ cat normal1
178 $ cat normal1
179 normal1
179 normal1
180 $ cat large1
180 $ cat large1
181 large1
181 large1
182 $ cat sub/normal2
182 $ cat sub/normal2
183 normal2
183 normal2
184 $ cat sub/large2
184 $ cat sub/large2
185 large2
185 large2
186 $ cd ../archive1
186 $ cd ../archive1
187 $ cat normal1
187 $ cat normal1
188 normal11
188 normal11
189 $ cat large1
189 $ cat large1
190 large11
190 large11
191 $ cat sub/normal2
191 $ cat sub/normal2
192 normal22
192 normal22
193 $ cat sub/large2
193 $ cat sub/large2
194 large22
194 large22
195 $ cd ../archive2
195 $ cd ../archive2
196 $ ls
196 $ ls
197 sub
197 sub
198 $ cat sub/normal2
198 $ cat sub/normal2
199 normal22
199 normal22
200 $ cat sub/large2
200 $ cat sub/large2
201 large22
201 large22
202 $ cd ../archive3
202 $ cd ../archive3
203 $ cat normal1
203 $ cat normal1
204 normal22
204 normal22
205 $ cat large1
205 $ cat large1
206 large22
206 large22
207 $ cat sub/normal2
207 $ cat sub/normal2
208 normal22
208 normal22
209 $ cat sub/large2
209 $ cat sub/large2
210 large22
210 large22
211 $ cd ../archive4
211 $ cd ../archive4
212 $ cat normal3
212 $ cat normal3
213 normal22
213 normal22
214 $ cat large3
214 $ cat large3
215 large22
215 large22
216 $ cat sub/normal4
216 $ cat sub/normal4
217 normal22
217 normal22
218 $ cat sub/large4
218 $ cat sub/large4
219 large22
219 large22
220
220
221 Commit corner case: specify files to commit.
221 Commit corner case: specify files to commit.
222
222
223 $ cd ../a
223 $ cd ../a
224 $ echo normal3 > normal3
224 $ echo normal3 > normal3
225 $ echo large3 > large3
225 $ echo large3 > large3
226 $ echo normal4 > sub/normal4
226 $ echo normal4 > sub/normal4
227 $ echo large4 > sub/large4
227 $ echo large4 > sub/large4
228 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
228 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
229 Invoking status precommit hook
229 Invoking status precommit hook
230 M large3
230 M large3
231 M normal3
231 M normal3
232 M sub/large4
232 M sub/large4
233 M sub/normal4
233 M sub/normal4
234 $ cat normal3
234 $ cat normal3
235 normal3
235 normal3
236 $ cat large3
236 $ cat large3
237 large3
237 large3
238 $ cat sub/normal4
238 $ cat sub/normal4
239 normal4
239 normal4
240 $ cat sub/large4
240 $ cat sub/large4
241 large4
241 large4
242
242
243 One more commit corner case: commit from a subdirectory.
243 One more commit corner case: commit from a subdirectory.
244
244
245 $ cd ../a
245 $ cd ../a
246 $ echo normal33 > normal3
246 $ echo normal33 > normal3
247 $ echo large33 > large3
247 $ echo large33 > large3
248 $ echo normal44 > sub/normal4
248 $ echo normal44 > sub/normal4
249 $ echo large44 > sub/large4
249 $ echo large44 > sub/large4
250 $ cd sub
250 $ cd sub
251 $ hg commit -m "edit files yet again"
251 $ hg commit -m "edit files yet again"
252 Invoking status precommit hook
252 Invoking status precommit hook
253 M large3
253 M large3
254 M normal3
254 M normal3
255 M sub/large4
255 M sub/large4
256 M sub/normal4
256 M sub/normal4
257 $ cat ../normal3
257 $ cat ../normal3
258 normal33
258 normal33
259 $ cat ../large3
259 $ cat ../large3
260 large33
260 large33
261 $ cat normal4
261 $ cat normal4
262 normal44
262 normal44
263 $ cat large4
263 $ cat large4
264 large44
264 large44
265
265
266 Committing standins is not allowed.
266 Committing standins is not allowed.
267
267
268 $ cd ..
268 $ cd ..
269 $ echo large3 > large3
269 $ echo large3 > large3
270 $ hg commit .hglf/large3 -m "try to commit standin"
270 $ hg commit .hglf/large3 -m "try to commit standin"
271 abort: file ".hglf/large3" is a largefile standin
271 abort: file ".hglf/large3" is a largefile standin
272 (commit the largefile itself instead)
272 (commit the largefile itself instead)
273 [255]
273 [255]
274
274
275 Corner cases for adding largefiles.
275 Corner cases for adding largefiles.
276
276
277 $ echo large5 > large5
277 $ echo large5 > large5
278 $ hg add --large large5
278 $ hg add --large large5
279 $ hg add --large large5
279 $ hg add --large large5
280 large5 already a largefile
280 large5 already a largefile
281 $ mkdir sub2
281 $ mkdir sub2
282 $ echo large6 > sub2/large6
282 $ echo large6 > sub2/large6
283 $ echo large7 > sub2/large7
283 $ echo large7 > sub2/large7
284 $ hg add --large sub2
284 $ hg add --large sub2
285 adding sub2/large6 as a largefile (glob)
285 adding sub2/large6 as a largefile (glob)
286 adding sub2/large7 as a largefile (glob)
286 adding sub2/large7 as a largefile (glob)
287 $ hg st
287 $ hg st
288 M large3
288 M large3
289 A large5
289 A large5
290 A sub2/large6
290 A sub2/large6
291 A sub2/large7
291 A sub2/large7
292
292
293 Test "hg status" with combination of 'file pattern' and 'directory
293 Test "hg status" with combination of 'file pattern' and 'directory
294 pattern' for largefiles:
294 pattern' for largefiles:
295
295
296 $ hg status sub2/large6 sub2
296 $ hg status sub2/large6 sub2
297 A sub2/large6
297 A sub2/large6
298 A sub2/large7
298 A sub2/large7
299
299
300 Config settings (pattern **.dat, minsize 2 MB) are respected.
300 Config settings (pattern **.dat, minsize 2 MB) are respected.
301
301
302 $ echo testdata > test.dat
302 $ echo testdata > test.dat
303 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
303 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
304 $ hg add
304 $ hg add
305 adding reallylarge as a largefile
305 adding reallylarge as a largefile
306 adding test.dat as a largefile
306 adding test.dat as a largefile
307
307
308 Test that minsize and --lfsize handle float values;
308 Test that minsize and --lfsize handle float values;
309 also tests that --lfsize overrides largefiles.minsize.
309 also tests that --lfsize overrides largefiles.minsize.
310 (0.250 MB = 256 kB = 262144 B)
310 (0.250 MB = 256 kB = 262144 B)
311
311
312 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
312 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
313 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
313 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
314 $ hg --config largefiles.minsize=.25 add
314 $ hg --config largefiles.minsize=.25 add
315 adding ratherlarge as a largefile
315 adding ratherlarge as a largefile
316 adding medium
316 adding medium
317 $ hg forget medium
317 $ hg forget medium
318 $ hg --config largefiles.minsize=.25 add --lfsize=.125
318 $ hg --config largefiles.minsize=.25 add --lfsize=.125
319 adding medium as a largefile
319 adding medium as a largefile
320 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
320 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
321 $ hg --config largefiles.minsize=.25 add --lfsize=.125
321 $ hg --config largefiles.minsize=.25 add --lfsize=.125
322 adding notlarge
322 adding notlarge
323 $ hg forget notlarge
323 $ hg forget notlarge
324
324
325 Test forget on largefiles.
325 Test forget on largefiles.
326
326
327 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
327 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
328 $ hg commit -m "add/edit more largefiles"
328 $ hg commit -m "add/edit more largefiles"
329 Invoking status precommit hook
329 Invoking status precommit hook
330 A sub2/large6
330 A sub2/large6
331 A sub2/large7
331 A sub2/large7
332 R large3
332 R large3
333 ? large5
333 ? large5
334 ? medium
334 ? medium
335 ? notlarge
335 ? notlarge
336 ? ratherlarge
336 ? ratherlarge
337 ? reallylarge
337 ? reallylarge
338 ? test.dat
338 ? test.dat
339 $ hg st
339 $ hg st
340 ? large3
340 ? large3
341 ? large5
341 ? large5
342 ? medium
342 ? medium
343 ? notlarge
343 ? notlarge
344 ? ratherlarge
344 ? ratherlarge
345 ? reallylarge
345 ? reallylarge
346 ? test.dat
346 ? test.dat
347
347
348 Purge with largefiles: verify that largefiles are still in the working
348 Purge with largefiles: verify that largefiles are still in the working
349 dir after a purge.
349 dir after a purge.
350
350
351 $ hg purge --all
351 $ hg purge --all
352 $ cat sub/large4
352 $ cat sub/large4
353 large44
353 large44
354 $ cat sub2/large6
354 $ cat sub2/large6
355 large6
355 large6
356 $ cat sub2/large7
356 $ cat sub2/large7
357 large7
357 large7
358
358
359 Test addremove: verify that files that should be added as largfiles are added as
359 Test addremove: verify that files that should be added as largfiles are added as
360 such and that already-existing largfiles are not added as normal files by
360 such and that already-existing largfiles are not added as normal files by
361 accident.
361 accident.
362
362
363 $ rm normal3
363 $ rm normal3
364 $ rm sub/large4
364 $ rm sub/large4
365 $ echo "testing addremove with patterns" > testaddremove.dat
365 $ echo "testing addremove with patterns" > testaddremove.dat
366 $ echo "normaladdremove" > normaladdremove
366 $ echo "normaladdremove" > normaladdremove
367 $ hg addremove
367 $ hg addremove
368 removing sub/large4
368 removing sub/large4
369 adding testaddremove.dat as a largefile
369 adding testaddremove.dat as a largefile
370 removing normal3
370 removing normal3
371 adding normaladdremove
371 adding normaladdremove
372
372
373 Test addremove with -R
373 Test addremove with -R
374
374
375 $ hg up -C
375 $ hg up -C
376 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
376 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 getting changed largefiles
377 getting changed largefiles
378 1 largefiles updated, 0 removed
378 1 largefiles updated, 0 removed
379 $ rm normal3
379 $ rm normal3
380 $ rm sub/large4
380 $ rm sub/large4
381 $ echo "testing addremove with patterns" > testaddremove.dat
381 $ echo "testing addremove with patterns" > testaddremove.dat
382 $ echo "normaladdremove" > normaladdremove
382 $ echo "normaladdremove" > normaladdremove
383 $ cd ..
383 $ cd ..
384 $ hg -R a addremove
384 $ hg -R a addremove
385 removing sub/large4
385 removing sub/large4
386 adding a/testaddremove.dat as a largefile (glob)
386 adding a/testaddremove.dat as a largefile (glob)
387 removing normal3
387 removing normal3
388 adding normaladdremove
388 adding normaladdremove
389 $ cd a
389 $ cd a
390
390
391 Test 3364
391 Test 3364
392 $ hg clone . ../addrm
392 $ hg clone . ../addrm
393 updating to branch default
393 updating to branch default
394 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
394 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
395 getting changed largefiles
395 getting changed largefiles
396 3 largefiles updated, 0 removed
396 3 largefiles updated, 0 removed
397 $ cd ../addrm
397 $ cd ../addrm
398 $ cat >> .hg/hgrc <<EOF
398 $ cat >> .hg/hgrc <<EOF
399 > [hooks]
399 > [hooks]
400 > post-commit.stat=sh -c "echo \"Invoking status postcommit hook\"; hg status -A"
400 > post-commit.stat=sh -c "echo \"Invoking status postcommit hook\"; hg status -A"
401 > EOF
401 > EOF
402 $ touch foo
402 $ touch foo
403 $ hg add --large foo
403 $ hg add --large foo
404 $ hg ci -m "add foo"
404 $ hg ci -m "add foo"
405 Invoking status precommit hook
405 Invoking status precommit hook
406 A foo
406 A foo
407 Invoking status postcommit hook
407 Invoking status postcommit hook
408 C foo
408 C foo
409 C normal3
409 C normal3
410 C sub/large4
410 C sub/large4
411 C sub/normal4
411 C sub/normal4
412 C sub2/large6
412 C sub2/large6
413 C sub2/large7
413 C sub2/large7
414 $ rm foo
414 $ rm foo
415 $ hg st
415 $ hg st
416 ! foo
416 ! foo
417 hmm.. no precommit invoked, but there is a postcommit??
417 hmm.. no precommit invoked, but there is a postcommit??
418 $ hg ci -m "will not checkin"
418 $ hg ci -m "will not checkin"
419 nothing changed
419 nothing changed
420 Invoking status postcommit hook
420 Invoking status postcommit hook
421 ! foo
421 ! foo
422 C normal3
422 C normal3
423 C sub/large4
423 C sub/large4
424 C sub/normal4
424 C sub/normal4
425 C sub2/large6
425 C sub2/large6
426 C sub2/large7
426 C sub2/large7
427 [1]
427 [1]
428 $ hg addremove
428 $ hg addremove
429 removing foo
429 removing foo
430 $ hg st
430 $ hg st
431 R foo
431 R foo
432 $ hg ci -m "used to say nothing changed"
432 $ hg ci -m "used to say nothing changed"
433 Invoking status precommit hook
433 Invoking status precommit hook
434 R foo
434 R foo
435 Invoking status postcommit hook
435 Invoking status postcommit hook
436 C normal3
436 C normal3
437 C sub/large4
437 C sub/large4
438 C sub/normal4
438 C sub/normal4
439 C sub2/large6
439 C sub2/large6
440 C sub2/large7
440 C sub2/large7
441 $ hg st
441 $ hg st
442
442
443 Test 3507 (both normal files and largefiles were a problem)
443 Test 3507 (both normal files and largefiles were a problem)
444
444
445 $ touch normal
445 $ touch normal
446 $ touch large
446 $ touch large
447 $ hg add normal
447 $ hg add normal
448 $ hg add --large large
448 $ hg add --large large
449 $ hg ci -m "added"
449 $ hg ci -m "added"
450 Invoking status precommit hook
450 Invoking status precommit hook
451 A large
451 A large
452 A normal
452 A normal
453 Invoking status postcommit hook
453 Invoking status postcommit hook
454 C large
454 C large
455 C normal
455 C normal
456 C normal3
456 C normal3
457 C sub/large4
457 C sub/large4
458 C sub/normal4
458 C sub/normal4
459 C sub2/large6
459 C sub2/large6
460 C sub2/large7
460 C sub2/large7
461 $ hg remove normal
461 $ hg remove normal
462 $ hg addremove --traceback
462 $ hg addremove --traceback
463 $ hg ci -m "addremoved normal"
463 $ hg ci -m "addremoved normal"
464 Invoking status precommit hook
464 Invoking status precommit hook
465 R normal
465 R normal
466 Invoking status postcommit hook
466 Invoking status postcommit hook
467 C large
467 C large
468 C normal3
468 C normal3
469 C sub/large4
469 C sub/large4
470 C sub/normal4
470 C sub/normal4
471 C sub2/large6
471 C sub2/large6
472 C sub2/large7
472 C sub2/large7
473 $ hg up -C '.^'
473 $ hg up -C '.^'
474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 getting changed largefiles
475 getting changed largefiles
476 0 largefiles updated, 0 removed
476 0 largefiles updated, 0 removed
477 $ hg remove large
477 $ hg remove large
478 $ hg addremove --traceback
478 $ hg addremove --traceback
479 $ hg ci -m "removed large"
479 $ hg ci -m "removed large"
480 Invoking status precommit hook
480 Invoking status precommit hook
481 R large
481 R large
482 created new head
482 created new head
483 Invoking status postcommit hook
483 Invoking status postcommit hook
484 C normal
484 C normal
485 C normal3
485 C normal3
486 C sub/large4
486 C sub/large4
487 C sub/normal4
487 C sub/normal4
488 C sub2/large6
488 C sub2/large6
489 C sub2/large7
489 C sub2/large7
490
490
491 Test that a standin can't be added as a large file
491 Test that a standin can't be added as a large file
492
492
493 $ touch large
493 $ touch large
494 $ hg add --large large
494 $ hg add --large large
495 $ hg ci -m "add"
495 $ hg ci -m "add"
496 Invoking status precommit hook
496 Invoking status precommit hook
497 A large
497 A large
498 Invoking status postcommit hook
498 Invoking status postcommit hook
499 C large
499 C large
500 C normal
500 C normal
501 C normal3
501 C normal3
502 C sub/large4
502 C sub/large4
503 C sub/normal4
503 C sub/normal4
504 C sub2/large6
504 C sub2/large6
505 C sub2/large7
505 C sub2/large7
506 $ hg remove large
506 $ hg remove large
507 $ touch large
507 $ touch large
508 $ hg addremove --config largefiles.patterns=**large --traceback
508 $ hg addremove --config largefiles.patterns=**large --traceback
509 adding large as a largefile
509 adding large as a largefile
510
510
511 $ cd ../a
511 $ cd ../a
512
512
513 Clone a largefiles repo.
513 Clone a largefiles repo.
514
514
515 $ hg clone . ../b
515 $ hg clone . ../b
516 updating to branch default
516 updating to branch default
517 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
517 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
518 getting changed largefiles
518 getting changed largefiles
519 3 largefiles updated, 0 removed
519 3 largefiles updated, 0 removed
520 $ cd ../b
520 $ cd ../b
521 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
521 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
522 7:daea875e9014 add/edit more largefiles
522 7:daea875e9014 add/edit more largefiles
523 6:4355d653f84f edit files yet again
523 6:4355d653f84f edit files yet again
524 5:9d5af5072dbd edit files again
524 5:9d5af5072dbd edit files again
525 4:74c02385b94c move files
525 4:74c02385b94c move files
526 3:9e8fbc4bce62 copy files
526 3:9e8fbc4bce62 copy files
527 2:51a0ae4d5864 remove files
527 2:51a0ae4d5864 remove files
528 1:ce8896473775 edit files
528 1:ce8896473775 edit files
529 0:30d30fe6a5be add files
529 0:30d30fe6a5be add files
530 $ cat normal3
530 $ cat normal3
531 normal33
531 normal33
532 $ cat sub/normal4
532 $ cat sub/normal4
533 normal44
533 normal44
534 $ cat sub/large4
534 $ cat sub/large4
535 large44
535 large44
536 $ cat sub2/large6
536 $ cat sub2/large6
537 large6
537 large6
538 $ cat sub2/large7
538 $ cat sub2/large7
539 large7
539 large7
540 $ cd ..
540 $ cd ..
541 $ hg clone a -r 3 c
541 $ hg clone a -r 3 c
542 adding changesets
542 adding changesets
543 adding manifests
543 adding manifests
544 adding file changes
544 adding file changes
545 added 4 changesets with 10 changes to 4 files
545 added 4 changesets with 10 changes to 4 files
546 updating to branch default
546 updating to branch default
547 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
547 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
548 getting changed largefiles
548 getting changed largefiles
549 2 largefiles updated, 0 removed
549 2 largefiles updated, 0 removed
550 $ cd c
550 $ cd c
551 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
551 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
552 3:9e8fbc4bce62 copy files
552 3:9e8fbc4bce62 copy files
553 2:51a0ae4d5864 remove files
553 2:51a0ae4d5864 remove files
554 1:ce8896473775 edit files
554 1:ce8896473775 edit files
555 0:30d30fe6a5be add files
555 0:30d30fe6a5be add files
556 $ cat normal1
556 $ cat normal1
557 normal22
557 normal22
558 $ cat large1
558 $ cat large1
559 large22
559 large22
560 $ cat sub/normal2
560 $ cat sub/normal2
561 normal22
561 normal22
562 $ cat sub/large2
562 $ cat sub/large2
563 large22
563 large22
564
564
565 Old revisions of a clone have correct largefiles content (this also
565 Old revisions of a clone have correct largefiles content (this also
566 tests update).
566 tests update).
567
567
568 $ hg update -r 1
568 $ hg update -r 1
569 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
569 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
570 getting changed largefiles
570 getting changed largefiles
571 1 largefiles updated, 0 removed
571 1 largefiles updated, 0 removed
572 $ cat large1
572 $ cat large1
573 large11
573 large11
574 $ cat sub/large2
574 $ cat sub/large2
575 large22
575 large22
576 $ cd ..
576 $ cd ..
577
577
578 Test cloning with --all-largefiles flag
578 Test cloning with --all-largefiles flag
579
579
580 $ rm "${USERCACHE}"/*
580 $ rm "${USERCACHE}"/*
581 $ hg clone --all-largefiles a a-backup
581 $ hg clone --all-largefiles a a-backup
582 updating to branch default
582 updating to branch default
583 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 getting changed largefiles
584 getting changed largefiles
585 3 largefiles updated, 0 removed
585 3 largefiles updated, 0 removed
586 8 additional largefiles cached
586 8 additional largefiles cached
587
587
588 $ hg clone --all-largefiles a ssh://localhost/a
588 $ hg clone --all-largefiles a ssh://localhost/a
589 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
589 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
590 [255]
590 [255]
591
591
592 Test pulling with --all-largefiles flag
592 Test pulling with --all-largefiles flag
593
593
594 $ rm -Rf a-backup
594 $ rm -Rf a-backup
595 $ hg clone -r 1 a a-backup
595 $ hg clone -r 1 a a-backup
596 adding changesets
596 adding changesets
597 adding manifests
597 adding manifests
598 adding file changes
598 adding file changes
599 added 2 changesets with 8 changes to 4 files
599 added 2 changesets with 8 changes to 4 files
600 updating to branch default
600 updating to branch default
601 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
601 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
602 getting changed largefiles
602 getting changed largefiles
603 2 largefiles updated, 0 removed
603 2 largefiles updated, 0 removed
604 $ rm "${USERCACHE}"/*
604 $ rm "${USERCACHE}"/*
605 $ cd a-backup
605 $ cd a-backup
606 $ hg pull --all-largefiles
606 $ hg pull --all-largefiles
607 pulling from $TESTTMP/a (glob)
607 pulling from $TESTTMP/a (glob)
608 searching for changes
608 searching for changes
609 adding changesets
609 adding changesets
610 adding manifests
610 adding manifests
611 adding file changes
611 adding file changes
612 added 6 changesets with 16 changes to 8 files
612 added 6 changesets with 16 changes to 8 files
613 (run 'hg update' to get a working copy)
613 (run 'hg update' to get a working copy)
614 caching new largefiles
614 caching new largefiles
615 3 largefiles cached
615 3 largefiles cached
616 3 additional largefiles cached
616 3 additional largefiles cached
617 $ cd ..
617 $ cd ..
618
618
619 Rebasing between two repositories does not revert largefiles to old
619 Rebasing between two repositories does not revert largefiles to old
620 revisions (this was a very bad bug that took a lot of work to fix).
620 revisions (this was a very bad bug that took a lot of work to fix).
621
621
622 $ hg clone a d
622 $ hg clone a d
623 updating to branch default
623 updating to branch default
624 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
624 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
625 getting changed largefiles
625 getting changed largefiles
626 3 largefiles updated, 0 removed
626 3 largefiles updated, 0 removed
627 $ cd b
627 $ cd b
628 $ echo large4-modified > sub/large4
628 $ echo large4-modified > sub/large4
629 $ echo normal3-modified > normal3
629 $ echo normal3-modified > normal3
630 $ hg commit -m "modify normal file and largefile in repo b"
630 $ hg commit -m "modify normal file and largefile in repo b"
631 Invoking status precommit hook
631 Invoking status precommit hook
632 M normal3
632 M normal3
633 M sub/large4
633 M sub/large4
634 $ cd ../d
634 $ cd ../d
635 $ echo large6-modified > sub2/large6
635 $ echo large6-modified > sub2/large6
636 $ echo normal4-modified > sub/normal4
636 $ echo normal4-modified > sub/normal4
637 $ hg commit -m "modify normal file largefile in repo d"
637 $ hg commit -m "modify normal file largefile in repo d"
638 Invoking status precommit hook
638 Invoking status precommit hook
639 M sub/normal4
639 M sub/normal4
640 M sub2/large6
640 M sub2/large6
641 $ cd ..
641 $ cd ..
642 $ hg clone d e
642 $ hg clone d e
643 updating to branch default
643 updating to branch default
644 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
644 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
645 getting changed largefiles
645 getting changed largefiles
646 3 largefiles updated, 0 removed
646 3 largefiles updated, 0 removed
647 $ cd d
647 $ cd d
648 $ hg pull --rebase ../b
648 $ hg pull --rebase ../b
649 pulling from ../b
649 pulling from ../b
650 searching for changes
650 searching for changes
651 adding changesets
651 adding changesets
652 adding manifests
652 adding manifests
653 adding file changes
653 adding file changes
654 added 1 changesets with 2 changes to 2 files (+1 heads)
654 added 1 changesets with 2 changes to 2 files (+1 heads)
655 Invoking status precommit hook
655 Invoking status precommit hook
656 M sub/normal4
656 M sub/normal4
657 M sub2/large6
657 M sub2/large6
658 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
658 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
659 nothing to rebase
659 nothing to rebase
660 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
660 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
661 9:598410d3eb9a modify normal file largefile in repo d
661 9:598410d3eb9a modify normal file largefile in repo d
662 8:a381d2c8c80e modify normal file and largefile in repo b
662 8:a381d2c8c80e modify normal file and largefile in repo b
663 7:daea875e9014 add/edit more largefiles
663 7:daea875e9014 add/edit more largefiles
664 6:4355d653f84f edit files yet again
664 6:4355d653f84f edit files yet again
665 5:9d5af5072dbd edit files again
665 5:9d5af5072dbd edit files again
666 4:74c02385b94c move files
666 4:74c02385b94c move files
667 3:9e8fbc4bce62 copy files
667 3:9e8fbc4bce62 copy files
668 2:51a0ae4d5864 remove files
668 2:51a0ae4d5864 remove files
669 1:ce8896473775 edit files
669 1:ce8896473775 edit files
670 0:30d30fe6a5be add files
670 0:30d30fe6a5be add files
671 $ cat normal3
671 $ cat normal3
672 normal3-modified
672 normal3-modified
673 $ cat sub/normal4
673 $ cat sub/normal4
674 normal4-modified
674 normal4-modified
675 $ cat sub/large4
675 $ cat sub/large4
676 large4-modified
676 large4-modified
677 $ cat sub2/large6
677 $ cat sub2/large6
678 large6-modified
678 large6-modified
679 $ cat sub2/large7
679 $ cat sub2/large7
680 large7
680 large7
681 $ cd ../e
681 $ cd ../e
682 $ hg pull ../b
682 $ hg pull ../b
683 pulling from ../b
683 pulling from ../b
684 searching for changes
684 searching for changes
685 adding changesets
685 adding changesets
686 adding manifests
686 adding manifests
687 adding file changes
687 adding file changes
688 added 1 changesets with 2 changes to 2 files (+1 heads)
688 added 1 changesets with 2 changes to 2 files (+1 heads)
689 (run 'hg heads' to see heads, 'hg merge' to merge)
689 (run 'hg heads' to see heads, 'hg merge' to merge)
690 caching new largefiles
690 caching new largefiles
691 0 largefiles cached
691 0 largefiles cached
692 $ hg rebase
692 $ hg rebase
693 Invoking status precommit hook
693 Invoking status precommit hook
694 M sub/normal4
694 M sub/normal4
695 M sub2/large6
695 M sub2/large6
696 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
696 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
697 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
697 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
698 9:598410d3eb9a modify normal file largefile in repo d
698 9:598410d3eb9a modify normal file largefile in repo d
699 8:a381d2c8c80e modify normal file and largefile in repo b
699 8:a381d2c8c80e modify normal file and largefile in repo b
700 7:daea875e9014 add/edit more largefiles
700 7:daea875e9014 add/edit more largefiles
701 6:4355d653f84f edit files yet again
701 6:4355d653f84f edit files yet again
702 5:9d5af5072dbd edit files again
702 5:9d5af5072dbd edit files again
703 4:74c02385b94c move files
703 4:74c02385b94c move files
704 3:9e8fbc4bce62 copy files
704 3:9e8fbc4bce62 copy files
705 2:51a0ae4d5864 remove files
705 2:51a0ae4d5864 remove files
706 1:ce8896473775 edit files
706 1:ce8896473775 edit files
707 0:30d30fe6a5be add files
707 0:30d30fe6a5be add files
708 $ cat normal3
708 $ cat normal3
709 normal3-modified
709 normal3-modified
710 $ cat sub/normal4
710 $ cat sub/normal4
711 normal4-modified
711 normal4-modified
712 $ cat sub/large4
712 $ cat sub/large4
713 large4-modified
713 large4-modified
714 $ cat sub2/large6
714 $ cat sub2/large6
715 large6-modified
715 large6-modified
716 $ cat sub2/large7
716 $ cat sub2/large7
717 large7
717 large7
718
718
719 Rollback on largefiles.
719 Rollback on largefiles.
720
720
721 $ echo large4-modified-again > sub/large4
721 $ echo large4-modified-again > sub/large4
722 $ hg commit -m "Modify large4 again"
722 $ hg commit -m "Modify large4 again"
723 Invoking status precommit hook
723 Invoking status precommit hook
724 M sub/large4
724 M sub/large4
725 $ hg rollback
725 $ hg rollback
726 repository tip rolled back to revision 9 (undo commit)
726 repository tip rolled back to revision 9 (undo commit)
727 working directory now based on revision 9
727 working directory now based on revision 9
728 $ hg st
728 $ hg st
729 M sub/large4
729 M sub/large4
730 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
730 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
731 9:598410d3eb9a modify normal file largefile in repo d
731 9:598410d3eb9a modify normal file largefile in repo d
732 8:a381d2c8c80e modify normal file and largefile in repo b
732 8:a381d2c8c80e modify normal file and largefile in repo b
733 7:daea875e9014 add/edit more largefiles
733 7:daea875e9014 add/edit more largefiles
734 6:4355d653f84f edit files yet again
734 6:4355d653f84f edit files yet again
735 5:9d5af5072dbd edit files again
735 5:9d5af5072dbd edit files again
736 4:74c02385b94c move files
736 4:74c02385b94c move files
737 3:9e8fbc4bce62 copy files
737 3:9e8fbc4bce62 copy files
738 2:51a0ae4d5864 remove files
738 2:51a0ae4d5864 remove files
739 1:ce8896473775 edit files
739 1:ce8896473775 edit files
740 0:30d30fe6a5be add files
740 0:30d30fe6a5be add files
741 $ cat sub/large4
741 $ cat sub/large4
742 large4-modified-again
742 large4-modified-again
743
743
744 "update --check" refuses to update with uncommitted changes.
744 "update --check" refuses to update with uncommitted changes.
745 $ hg update --check 8
745 $ hg update --check 8
746 abort: uncommitted local changes
746 abort: uncommitted local changes
747 [255]
747 [255]
748
748
749 "update --clean" leaves correct largefiles in working copy.
749 "update --clean" leaves correct largefiles in working copy.
750
750
751 $ hg update --clean
751 $ hg update --clean
752 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
752 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
753 getting changed largefiles
753 getting changed largefiles
754 1 largefiles updated, 0 removed
754 1 largefiles updated, 0 removed
755 $ cat normal3
755 $ cat normal3
756 normal3-modified
756 normal3-modified
757 $ cat sub/normal4
757 $ cat sub/normal4
758 normal4-modified
758 normal4-modified
759 $ cat sub/large4
759 $ cat sub/large4
760 large4-modified
760 large4-modified
761 $ cat sub2/large6
761 $ cat sub2/large6
762 large6-modified
762 large6-modified
763 $ cat sub2/large7
763 $ cat sub2/large7
764 large7
764 large7
765
765
766 Now "update check" is happy.
766 Now "update check" is happy.
767 $ hg update --check 8
767 $ hg update --check 8
768 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
768 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
769 getting changed largefiles
769 getting changed largefiles
770 1 largefiles updated, 0 removed
770 1 largefiles updated, 0 removed
771 $ hg update --check
771 $ hg update --check
772 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
772 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 getting changed largefiles
773 getting changed largefiles
774 1 largefiles updated, 0 removed
774 1 largefiles updated, 0 removed
775
775
776 Test removing empty largefiles directories on update
776 Test removing empty largefiles directories on update
777 $ test -d sub2 && echo "sub2 exists"
777 $ test -d sub2 && echo "sub2 exists"
778 sub2 exists
778 sub2 exists
779 $ hg update -q null
779 $ hg update -q null
780 $ test -d sub2 && echo "error: sub2 should not exist anymore"
780 $ test -d sub2 && echo "error: sub2 should not exist anymore"
781 [1]
781 [1]
782 $ hg update -q
782 $ hg update -q
783
783
784 Test hg remove removes empty largefiles directories
784 Test hg remove removes empty largefiles directories
785 $ test -d sub2 && echo "sub2 exists"
785 $ test -d sub2 && echo "sub2 exists"
786 sub2 exists
786 sub2 exists
787 $ hg remove sub2/*
787 $ hg remove sub2/*
788 $ test -d sub2 && echo "error: sub2 should not exist anymore"
788 $ test -d sub2 && echo "error: sub2 should not exist anymore"
789 [1]
789 [1]
790 $ hg revert sub2/large6 sub2/large7
790 $ hg revert sub2/large6 sub2/large7
791
791
792 "revert" works on largefiles (and normal files too).
792 "revert" works on largefiles (and normal files too).
793 $ echo hack3 >> normal3
793 $ echo hack3 >> normal3
794 $ echo hack4 >> sub/normal4
794 $ echo hack4 >> sub/normal4
795 $ echo hack4 >> sub/large4
795 $ echo hack4 >> sub/large4
796 $ rm sub2/large6
796 $ rm sub2/large6
797 $ hg revert sub2/large6
797 $ hg revert sub2/large6
798 $ hg rm sub2/large6
798 $ hg rm sub2/large6
799 $ echo new >> sub2/large8
799 $ echo new >> sub2/large8
800 $ hg add --large sub2/large8
800 $ hg add --large sub2/large8
801 # XXX we don't really want to report that we're reverting the standin;
801 # XXX we don't really want to report that we're reverting the standin;
802 # that's just an implementation detail. But I don't see an obvious fix. ;-(
802 # that's just an implementation detail. But I don't see an obvious fix. ;-(
803 $ hg revert sub
803 $ hg revert sub
804 reverting .hglf/sub/large4 (glob)
804 reverting .hglf/sub/large4 (glob)
805 reverting sub/normal4 (glob)
805 reverting sub/normal4 (glob)
806 $ hg status
806 $ hg status
807 M normal3
807 M normal3
808 A sub2/large8
808 A sub2/large8
809 R sub2/large6
809 R sub2/large6
810 ? sub/large4.orig
810 ? sub/large4.orig
811 ? sub/normal4.orig
811 ? sub/normal4.orig
812 $ cat sub/normal4
812 $ cat sub/normal4
813 normal4-modified
813 normal4-modified
814 $ cat sub/large4
814 $ cat sub/large4
815 large4-modified
815 large4-modified
816 $ hg revert -a --no-backup
816 $ hg revert -a --no-backup
817 undeleting .hglf/sub2/large6 (glob)
817 undeleting .hglf/sub2/large6 (glob)
818 forgetting .hglf/sub2/large8 (glob)
818 forgetting .hglf/sub2/large8 (glob)
819 reverting normal3
819 reverting normal3
820 $ hg status
820 $ hg status
821 ? sub/large4.orig
821 ? sub/large4.orig
822 ? sub/normal4.orig
822 ? sub/normal4.orig
823 ? sub2/large8
823 ? sub2/large8
824 $ cat normal3
824 $ cat normal3
825 normal3-modified
825 normal3-modified
826 $ cat sub2/large6
826 $ cat sub2/large6
827 large6-modified
827 large6-modified
828 $ rm sub/*.orig sub2/large8
828 $ rm sub/*.orig sub2/large8
829
829
830 revert some files to an older revision
830 revert some files to an older revision
831 $ hg revert --no-backup -r 8 sub2
831 $ hg revert --no-backup -r 8 sub2
832 reverting .hglf/sub2/large6 (glob)
832 reverting .hglf/sub2/large6 (glob)
833 $ cat sub2/large6
833 $ cat sub2/large6
834 large6
834 large6
835 $ hg revert --no-backup sub2
835 $ hg revert --no-backup sub2
836 reverting .hglf/sub2/large6 (glob)
836 reverting .hglf/sub2/large6 (glob)
837 $ hg status
837 $ hg status
838
838
839 "verify --large" actually verifies largefiles
839 "verify --large" actually verifies largefiles
840
840
841 $ hg verify --large
841 $ hg verify --large
842 checking changesets
842 checking changesets
843 checking manifests
843 checking manifests
844 crosschecking files in changesets and manifests
844 crosschecking files in changesets and manifests
845 checking files
845 checking files
846 10 files, 10 changesets, 28 total revisions
846 10 files, 10 changesets, 28 total revisions
847 searching 1 changesets for largefiles
847 searching 1 changesets for largefiles
848 verified existence of 3 revisions of 3 largefiles
848 verified existence of 3 revisions of 3 largefiles
849
849
850 Merging does not revert to old versions of largefiles and also check
850 Merging does not revert to old versions of largefiles and also check
851 that merging after having pulled from a non-default remote works
851 that merging after having pulled from a non-default remote works
852 correctly.
852 correctly.
853
853
854 $ cd ..
854 $ cd ..
855 $ hg clone -r 7 e temp
855 $ hg clone -r 7 e temp
856 adding changesets
856 adding changesets
857 adding manifests
857 adding manifests
858 adding file changes
858 adding file changes
859 added 8 changesets with 24 changes to 10 files
859 added 8 changesets with 24 changes to 10 files
860 updating to branch default
860 updating to branch default
861 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
861 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
862 getting changed largefiles
862 getting changed largefiles
863 3 largefiles updated, 0 removed
863 3 largefiles updated, 0 removed
864 $ hg clone temp f
864 $ hg clone temp f
865 updating to branch default
865 updating to branch default
866 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
866 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
867 getting changed largefiles
867 getting changed largefiles
868 3 largefiles updated, 0 removed
868 3 largefiles updated, 0 removed
869 # Delete the largefiles in the largefiles system cache so that we have an
869 # Delete the largefiles in the largefiles system cache so that we have an
870 # opportunity to test that caching after a pull works.
870 # opportunity to test that caching after a pull works.
871 $ rm "${USERCACHE}"/*
871 $ rm "${USERCACHE}"/*
872 $ cd f
872 $ cd f
873 $ echo "large4-merge-test" > sub/large4
873 $ echo "large4-merge-test" > sub/large4
874 $ hg commit -m "Modify large4 to test merge"
874 $ hg commit -m "Modify large4 to test merge"
875 Invoking status precommit hook
875 Invoking status precommit hook
876 M sub/large4
876 M sub/large4
877 $ hg pull ../e
877 $ hg pull ../e
878 pulling from ../e
878 pulling from ../e
879 searching for changes
879 searching for changes
880 adding changesets
880 adding changesets
881 adding manifests
881 adding manifests
882 adding file changes
882 adding file changes
883 added 2 changesets with 4 changes to 4 files (+1 heads)
883 added 2 changesets with 4 changes to 4 files (+1 heads)
884 (run 'hg heads' to see heads, 'hg merge' to merge)
884 (run 'hg heads' to see heads, 'hg merge' to merge)
885 caching new largefiles
885 caching new largefiles
886 2 largefiles cached
886 2 largefiles cached
887 $ hg merge
887 $ hg merge
888 merging sub/large4
888 merging sub/large4
889 largefile sub/large4 has a merge conflict
889 largefile sub/large4 has a merge conflict
890 keep (l)ocal or take (o)ther? l
890 keep (l)ocal or take (o)ther? l
891 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
891 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
892 (branch merge, don't forget to commit)
892 (branch merge, don't forget to commit)
893 getting changed largefiles
893 getting changed largefiles
894 1 largefiles updated, 0 removed
894 1 largefiles updated, 0 removed
895 $ hg commit -m "Merge repos e and f"
895 $ hg commit -m "Merge repos e and f"
896 Invoking status precommit hook
896 Invoking status precommit hook
897 M normal3
897 M normal3
898 M sub/normal4
898 M sub/normal4
899 M sub2/large6
899 M sub2/large6
900 $ cat normal3
900 $ cat normal3
901 normal3-modified
901 normal3-modified
902 $ cat sub/normal4
902 $ cat sub/normal4
903 normal4-modified
903 normal4-modified
904 $ cat sub/large4
904 $ cat sub/large4
905 large4-merge-test
905 large4-merge-test
906 $ cat sub2/large6
906 $ cat sub2/large6
907 large6-modified
907 large6-modified
908 $ cat sub2/large7
908 $ cat sub2/large7
909 large7
909 large7
910
910
911 Test status after merging with a branch that introduces a new largefile:
911 Test status after merging with a branch that introduces a new largefile:
912
912
913 $ echo large > large
913 $ echo large > large
914 $ hg add --large large
914 $ hg add --large large
915 $ hg commit -m 'add largefile'
915 $ hg commit -m 'add largefile'
916 Invoking status precommit hook
916 Invoking status precommit hook
917 A large
917 A large
918 $ hg update -q ".^"
918 $ hg update -q ".^"
919 $ echo change >> normal3
919 $ echo change >> normal3
920 $ hg commit -m 'some change'
920 $ hg commit -m 'some change'
921 Invoking status precommit hook
921 Invoking status precommit hook
922 M normal3
922 M normal3
923 created new head
923 created new head
924 $ hg merge
924 $ hg merge
925 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
925 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
926 (branch merge, don't forget to commit)
926 (branch merge, don't forget to commit)
927 getting changed largefiles
927 getting changed largefiles
928 1 largefiles updated, 0 removed
928 1 largefiles updated, 0 removed
929 $ hg status
929 $ hg status
930 M large
930 M large
931
931
932 Test that a normal file and a largefile with the same name and path cannot
932 Test that a normal file and a largefile with the same name and path cannot
933 coexist.
933 coexist.
934
934
935 $ rm sub2/large7
935 $ rm sub2/large7
936 $ echo "largeasnormal" > sub2/large7
936 $ echo "largeasnormal" > sub2/large7
937 $ hg add sub2/large7
937 $ hg add sub2/large7
938 sub2/large7 already a largefile
938 sub2/large7 already a largefile
939
939
940 Test that transplanting a largefile change works correctly.
940 Test that transplanting a largefile change works correctly.
941
941
942 $ cd ..
942 $ cd ..
943 $ hg clone -r 8 d g
943 $ hg clone -r 8 d g
944 adding changesets
944 adding changesets
945 adding manifests
945 adding manifests
946 adding file changes
946 adding file changes
947 added 9 changesets with 26 changes to 10 files
947 added 9 changesets with 26 changes to 10 files
948 updating to branch default
948 updating to branch default
949 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
949 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
950 getting changed largefiles
950 getting changed largefiles
951 3 largefiles updated, 0 removed
951 3 largefiles updated, 0 removed
952 $ cd g
952 $ cd g
953 $ hg transplant -s ../d 598410d3eb9a
953 $ hg transplant -s ../d 598410d3eb9a
954 searching for changes
954 searching for changes
955 searching for changes
955 searching for changes
956 adding changesets
956 adding changesets
957 adding manifests
957 adding manifests
958 adding file changes
958 adding file changes
959 added 1 changesets with 2 changes to 2 files
959 added 1 changesets with 2 changes to 2 files
960 getting changed largefiles
960 getting changed largefiles
961 1 largefiles updated, 0 removed
961 1 largefiles updated, 0 removed
962 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
962 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
963 9:598410d3eb9a modify normal file largefile in repo d
963 9:598410d3eb9a modify normal file largefile in repo d
964 8:a381d2c8c80e modify normal file and largefile in repo b
964 8:a381d2c8c80e modify normal file and largefile in repo b
965 7:daea875e9014 add/edit more largefiles
965 7:daea875e9014 add/edit more largefiles
966 6:4355d653f84f edit files yet again
966 6:4355d653f84f edit files yet again
967 5:9d5af5072dbd edit files again
967 5:9d5af5072dbd edit files again
968 4:74c02385b94c move files
968 4:74c02385b94c move files
969 3:9e8fbc4bce62 copy files
969 3:9e8fbc4bce62 copy files
970 2:51a0ae4d5864 remove files
970 2:51a0ae4d5864 remove files
971 1:ce8896473775 edit files
971 1:ce8896473775 edit files
972 0:30d30fe6a5be add files
972 0:30d30fe6a5be add files
973 $ cat normal3
973 $ cat normal3
974 normal3-modified
974 normal3-modified
975 $ cat sub/normal4
975 $ cat sub/normal4
976 normal4-modified
976 normal4-modified
977 $ cat sub/large4
977 $ cat sub/large4
978 large4-modified
978 large4-modified
979 $ cat sub2/large6
979 $ cat sub2/large6
980 large6-modified
980 large6-modified
981 $ cat sub2/large7
981 $ cat sub2/large7
982 large7
982 large7
983
983
984 Cat a largefile
984 Cat a largefile
985 $ hg cat normal3
985 $ hg cat normal3
986 normal3-modified
986 normal3-modified
987 $ hg cat sub/large4
987 $ hg cat sub/large4
988 large4-modified
988 large4-modified
989 $ rm "${USERCACHE}"/*
989 $ rm "${USERCACHE}"/*
990 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
990 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
991 $ cat cat.out
991 $ cat cat.out
992 large4-modified
992 large4-modified
993 $ rm cat.out
993 $ rm cat.out
994 $ hg cat -r a381d2c8c80e normal3
994 $ hg cat -r a381d2c8c80e normal3
995 normal3-modified
995 normal3-modified
996
996
997 Test that renaming a largefile results in correct output for status
997 Test that renaming a largefile results in correct output for status
998
998
999 $ hg rename sub/large4 large4-renamed
999 $ hg rename sub/large4 large4-renamed
1000 $ hg commit -m "test rename output"
1000 $ hg commit -m "test rename output"
1001 Invoking status precommit hook
1001 Invoking status precommit hook
1002 A large4-renamed
1002 A large4-renamed
1003 R sub/large4
1003 R sub/large4
1004 $ cat large4-renamed
1004 $ cat large4-renamed
1005 large4-modified
1005 large4-modified
1006 $ cd sub2
1006 $ cd sub2
1007 $ hg rename large6 large6-renamed
1007 $ hg rename large6 large6-renamed
1008 $ hg st
1008 $ hg st
1009 A sub2/large6-renamed
1009 A sub2/large6-renamed
1010 R sub2/large6
1010 R sub2/large6
1011 $ cd ..
1011 $ cd ..
1012
1012
1013 Test --normal flag
1013 Test --normal flag
1014
1014
1015 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1015 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1016 $ hg add --normal --large new-largefile
1016 $ hg add --normal --large new-largefile
1017 abort: --normal cannot be used with --large
1017 abort: --normal cannot be used with --large
1018 [255]
1018 [255]
1019 $ hg add --normal new-largefile
1019 $ hg add --normal new-largefile
1020 new-largefile: up to 69 MB of RAM may be required to manage this file
1020 new-largefile: up to 69 MB of RAM may be required to manage this file
1021 (use 'hg revert new-largefile' to cancel the pending addition)
1021 (use 'hg revert new-largefile' to cancel the pending addition)
1022 $ cd ..
1022 $ cd ..
1023
1023
1024 #if serve
1024 #if serve
1025 vanilla clients not locked out from largefiles servers on vanilla repos
1025 vanilla clients not locked out from largefiles servers on vanilla repos
1026 $ mkdir r1
1026 $ mkdir r1
1027 $ cd r1
1027 $ cd r1
1028 $ hg init
1028 $ hg init
1029 $ echo c1 > f1
1029 $ echo c1 > f1
1030 $ hg add f1
1030 $ hg add f1
1031 $ hg commit -m "m1"
1031 $ hg commit -m "m1"
1032 Invoking status precommit hook
1032 Invoking status precommit hook
1033 A f1
1033 A f1
1034 $ cd ..
1034 $ cd ..
1035 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1035 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1036 $ cat hg.pid >> $DAEMON_PIDS
1036 $ cat hg.pid >> $DAEMON_PIDS
1037 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1037 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1038 requesting all changes
1038 requesting all changes
1039 adding changesets
1039 adding changesets
1040 adding manifests
1040 adding manifests
1041 adding file changes
1041 adding file changes
1042 added 1 changesets with 1 changes to 1 files
1042 added 1 changesets with 1 changes to 1 files
1043 updating to branch default
1043 updating to branch default
1044 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1044 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1045
1045
1046 largefiles clients still work with vanilla servers
1046 largefiles clients still work with vanilla servers
1047 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1047 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1048 $ cat hg.pid >> $DAEMON_PIDS
1048 $ cat hg.pid >> $DAEMON_PIDS
1049 $ hg clone http://localhost:$HGPORT1 r3
1049 $ hg clone http://localhost:$HGPORT1 r3
1050 requesting all changes
1050 requesting all changes
1051 adding changesets
1051 adding changesets
1052 adding manifests
1052 adding manifests
1053 adding file changes
1053 adding file changes
1054 added 1 changesets with 1 changes to 1 files
1054 added 1 changesets with 1 changes to 1 files
1055 updating to branch default
1055 updating to branch default
1056 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1056 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1057 #endif
1057 #endif
1058
1058
1059
1059
1060 vanilla clients locked out from largefiles http repos
1060 vanilla clients locked out from largefiles http repos
1061 $ mkdir r4
1061 $ mkdir r4
1062 $ cd r4
1062 $ cd r4
1063 $ hg init
1063 $ hg init
1064 $ echo c1 > f1
1064 $ echo c1 > f1
1065 $ hg add --large f1
1065 $ hg add --large f1
1066 $ hg commit -m "m1"
1066 $ hg commit -m "m1"
1067 Invoking status precommit hook
1067 Invoking status precommit hook
1068 A f1
1068 A f1
1069 $ cd ..
1069 $ cd ..
1070
1070
1071 #if serve
1071 #if serve
1072 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1072 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1073 $ cat hg.pid >> $DAEMON_PIDS
1073 $ cat hg.pid >> $DAEMON_PIDS
1074 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1074 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1075 abort: remote error:
1075 abort: remote error:
1076
1076
1077 This repository uses the largefiles extension.
1077 This repository uses the largefiles extension.
1078
1078
1079 Please enable it in your Mercurial config file.
1079 Please enable it in your Mercurial config file.
1080 [255]
1080 [255]
1081
1081
1082 used all HGPORTs, kill all daemons
1082 used all HGPORTs, kill all daemons
1083 $ "$TESTDIR/killdaemons.py"
1083 $ "$TESTDIR/killdaemons.py"
1084 #endif
1084 #endif
1085
1085
1086 vanilla clients locked out from largefiles ssh repos
1086 vanilla clients locked out from largefiles ssh repos
1087 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1087 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1088 abort: remote error:
1088 abort: remote error:
1089
1089
1090 This repository uses the largefiles extension.
1090 This repository uses the largefiles extension.
1091
1091
1092 Please enable it in your Mercurial config file.
1092 Please enable it in your Mercurial config file.
1093 [255]
1093 [255]
1094
1094
1095 #if serve
1095 #if serve
1096
1096
1097 largefiles clients refuse to push largefiles repos to vanilla servers
1097 largefiles clients refuse to push largefiles repos to vanilla servers
1098 $ mkdir r6
1098 $ mkdir r6
1099 $ cd r6
1099 $ cd r6
1100 $ hg init
1100 $ hg init
1101 $ echo c1 > f1
1101 $ echo c1 > f1
1102 $ hg add f1
1102 $ hg add f1
1103 $ hg commit -m "m1"
1103 $ hg commit -m "m1"
1104 Invoking status precommit hook
1104 Invoking status precommit hook
1105 A f1
1105 A f1
1106 $ cat >> .hg/hgrc <<!
1106 $ cat >> .hg/hgrc <<!
1107 > [web]
1107 > [web]
1108 > push_ssl = false
1108 > push_ssl = false
1109 > allow_push = *
1109 > allow_push = *
1110 > !
1110 > !
1111 $ cd ..
1111 $ cd ..
1112 $ hg clone r6 r7
1112 $ hg clone r6 r7
1113 updating to branch default
1113 updating to branch default
1114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1115 $ cd r7
1115 $ cd r7
1116 $ echo c2 > f2
1116 $ echo c2 > f2
1117 $ hg add --large f2
1117 $ hg add --large f2
1118 $ hg commit -m "m2"
1118 $ hg commit -m "m2"
1119 Invoking status precommit hook
1119 Invoking status precommit hook
1120 A f2
1120 A f2
1121 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1121 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1122 $ cat ../hg.pid >> $DAEMON_PIDS
1122 $ cat ../hg.pid >> $DAEMON_PIDS
1123 $ hg push http://localhost:$HGPORT
1123 $ hg push http://localhost:$HGPORT
1124 pushing to http://localhost:$HGPORT/
1124 pushing to http://localhost:$HGPORT/
1125 searching for changes
1125 searching for changes
1126 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1126 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1127 [255]
1127 [255]
1128 $ cd ..
1128 $ cd ..
1129
1129
1130 putlfile errors are shown (issue3123)
1130 putlfile errors are shown (issue3123)
1131 Corrupt the cached largefile in r7
1131 Corrupt the cached largefile in r7 and in the usercache (required for testing on vfat)
1132 $ echo corruption > "$TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8"
1132 $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1133 $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1133 $ hg init empty
1134 $ hg init empty
1134 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1135 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1135 > --config 'web.allow_push=*' --config web.push_ssl=False
1136 > --config 'web.allow_push=*' --config web.push_ssl=False
1136 $ cat hg.pid >> $DAEMON_PIDS
1137 $ cat hg.pid >> $DAEMON_PIDS
1137 $ hg push -R r7 http://localhost:$HGPORT1
1138 $ hg push -R r7 http://localhost:$HGPORT1
1138 pushing to http://localhost:$HGPORT1/
1139 pushing to http://localhost:$HGPORT1/
1139 searching for changes
1140 searching for changes
1140 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1141 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1141 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1142 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1142 [255]
1143 [255]
1143 $ rm -rf empty
1144 $ rm -rf empty
1144
1145
1145 Push a largefiles repository to a served empty repository
1146 Push a largefiles repository to a served empty repository
1146 $ hg init r8
1147 $ hg init r8
1147 $ echo c3 > r8/f1
1148 $ echo c3 > r8/f1
1148 $ hg add --large r8/f1 -R r8
1149 $ hg add --large r8/f1 -R r8
1149 $ hg commit -m "m1" -R r8
1150 $ hg commit -m "m1" -R r8
1150 Invoking status precommit hook
1151 Invoking status precommit hook
1151 A f1
1152 A f1
1152 $ hg init empty
1153 $ hg init empty
1153 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1154 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1154 > --config 'web.allow_push=*' --config web.push_ssl=False
1155 > --config 'web.allow_push=*' --config web.push_ssl=False
1155 $ cat hg.pid >> $DAEMON_PIDS
1156 $ cat hg.pid >> $DAEMON_PIDS
1156 $ rm "${USERCACHE}"/*
1157 $ rm "${USERCACHE}"/*
1157 $ hg push -R r8 http://localhost:$HGPORT2
1158 $ hg push -R r8 http://localhost:$HGPORT2
1158 pushing to http://localhost:$HGPORT2/
1159 pushing to http://localhost:$HGPORT2/
1159 searching for changes
1160 searching for changes
1160 searching for changes
1161 searching for changes
1161 remote: adding changesets
1162 remote: adding changesets
1162 remote: adding manifests
1163 remote: adding manifests
1163 remote: adding file changes
1164 remote: adding file changes
1164 remote: added 1 changesets with 1 changes to 1 files
1165 remote: added 1 changesets with 1 changes to 1 files
1165 $ rm -rf empty
1166 $ rm -rf empty
1166
1167
1167 used all HGPORTs, kill all daemons
1168 used all HGPORTs, kill all daemons
1168 $ "$TESTDIR/killdaemons.py"
1169 $ "$TESTDIR/killdaemons.py"
1169
1170
1170 #endif
1171 #endif
1171
1172
1172
1173
1173 #if unix-permissions
1174 #if unix-permissions
1174
1175
1175 Clone a local repository owned by another user
1176 Clone a local repository owned by another user
1176 We have to simulate that here by setting $HOME and removing write permissions
1177 We have to simulate that here by setting $HOME and removing write permissions
1177 $ ORIGHOME="$HOME"
1178 $ ORIGHOME="$HOME"
1178 $ mkdir alice
1179 $ mkdir alice
1179 $ HOME="`pwd`/alice"
1180 $ HOME="`pwd`/alice"
1180 $ cd alice
1181 $ cd alice
1181 $ hg init pubrepo
1182 $ hg init pubrepo
1182 $ cd pubrepo
1183 $ cd pubrepo
1183 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1184 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1184 $ hg add --large a-large-file
1185 $ hg add --large a-large-file
1185 $ hg commit -m "Add a large file"
1186 $ hg commit -m "Add a large file"
1186 Invoking status precommit hook
1187 Invoking status precommit hook
1187 A a-large-file
1188 A a-large-file
1188 $ cd ..
1189 $ cd ..
1189 $ chmod -R a-w pubrepo
1190 $ chmod -R a-w pubrepo
1190 $ cd ..
1191 $ cd ..
1191 $ mkdir bob
1192 $ mkdir bob
1192 $ HOME="`pwd`/bob"
1193 $ HOME="`pwd`/bob"
1193 $ cd bob
1194 $ cd bob
1194 $ hg clone --pull ../alice/pubrepo pubrepo
1195 $ hg clone --pull ../alice/pubrepo pubrepo
1195 requesting all changes
1196 requesting all changes
1196 adding changesets
1197 adding changesets
1197 adding manifests
1198 adding manifests
1198 adding file changes
1199 adding file changes
1199 added 1 changesets with 1 changes to 1 files
1200 added 1 changesets with 1 changes to 1 files
1200 updating to branch default
1201 updating to branch default
1201 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1202 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1202 getting changed largefiles
1203 getting changed largefiles
1203 1 largefiles updated, 0 removed
1204 1 largefiles updated, 0 removed
1204 $ cd ..
1205 $ cd ..
1205 $ chmod -R u+w alice/pubrepo
1206 $ chmod -R u+w alice/pubrepo
1206 $ HOME="$ORIGHOME"
1207 $ HOME="$ORIGHOME"
1207
1208
1208 #endif
1209 #endif
1209
1210
1210 #if symlink
1211 #if symlink
1211
1212
1212 Symlink to a large largefile should behave the same as a symlink to a normal file
1213 Symlink to a large largefile should behave the same as a symlink to a normal file
1213 $ hg init largesymlink
1214 $ hg init largesymlink
1214 $ cd largesymlink
1215 $ cd largesymlink
1215 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1216 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1216 $ hg add --large largefile
1217 $ hg add --large largefile
1217 $ hg commit -m "commit a large file"
1218 $ hg commit -m "commit a large file"
1218 Invoking status precommit hook
1219 Invoking status precommit hook
1219 A largefile
1220 A largefile
1220 $ ln -s largefile largelink
1221 $ ln -s largefile largelink
1221 $ hg add largelink
1222 $ hg add largelink
1222 $ hg commit -m "commit a large symlink"
1223 $ hg commit -m "commit a large symlink"
1223 Invoking status precommit hook
1224 Invoking status precommit hook
1224 A largelink
1225 A largelink
1225 $ rm -f largelink
1226 $ rm -f largelink
1226 $ hg up >/dev/null
1227 $ hg up >/dev/null
1227 $ test -f largelink
1228 $ test -f largelink
1228 [1]
1229 [1]
1229 $ test -L largelink
1230 $ test -L largelink
1230 [1]
1231 [1]
1231 $ rm -f largelink # make next part of the test independent of the previous
1232 $ rm -f largelink # make next part of the test independent of the previous
1232 $ hg up -C >/dev/null
1233 $ hg up -C >/dev/null
1233 $ test -f largelink
1234 $ test -f largelink
1234 $ test -L largelink
1235 $ test -L largelink
1235 $ cd ..
1236 $ cd ..
1236
1237
1237 #endif
1238 #endif
1238
1239
1239 test for pattern matching on 'hg status':
1240 test for pattern matching on 'hg status':
1240 to boost performance, largefiles checks whether specified patterns are
1241 to boost performance, largefiles checks whether specified patterns are
1241 related to largefiles in working directory (NOT to STANDIN) or not.
1242 related to largefiles in working directory (NOT to STANDIN) or not.
1242
1243
1243 $ hg init statusmatch
1244 $ hg init statusmatch
1244 $ cd statusmatch
1245 $ cd statusmatch
1245
1246
1246 $ mkdir -p a/b/c/d
1247 $ mkdir -p a/b/c/d
1247 $ echo normal > a/b/c/d/e.normal.txt
1248 $ echo normal > a/b/c/d/e.normal.txt
1248 $ hg add a/b/c/d/e.normal.txt
1249 $ hg add a/b/c/d/e.normal.txt
1249 $ echo large > a/b/c/d/e.large.txt
1250 $ echo large > a/b/c/d/e.large.txt
1250 $ hg add --large a/b/c/d/e.large.txt
1251 $ hg add --large a/b/c/d/e.large.txt
1251 $ mkdir -p a/b/c/x
1252 $ mkdir -p a/b/c/x
1252 $ echo normal > a/b/c/x/y.normal.txt
1253 $ echo normal > a/b/c/x/y.normal.txt
1253 $ hg add a/b/c/x/y.normal.txt
1254 $ hg add a/b/c/x/y.normal.txt
1254 $ hg commit -m 'add files'
1255 $ hg commit -m 'add files'
1255 Invoking status precommit hook
1256 Invoking status precommit hook
1256 A a/b/c/d/e.large.txt
1257 A a/b/c/d/e.large.txt
1257 A a/b/c/d/e.normal.txt
1258 A a/b/c/d/e.normal.txt
1258 A a/b/c/x/y.normal.txt
1259 A a/b/c/x/y.normal.txt
1259
1260
1260 (1) no pattern: no performance boost
1261 (1) no pattern: no performance boost
1261 $ hg status -A
1262 $ hg status -A
1262 C a/b/c/d/e.large.txt
1263 C a/b/c/d/e.large.txt
1263 C a/b/c/d/e.normal.txt
1264 C a/b/c/d/e.normal.txt
1264 C a/b/c/x/y.normal.txt
1265 C a/b/c/x/y.normal.txt
1265
1266
1266 (2) pattern not related to largefiles: performance boost
1267 (2) pattern not related to largefiles: performance boost
1267 $ hg status -A a/b/c/x
1268 $ hg status -A a/b/c/x
1268 C a/b/c/x/y.normal.txt
1269 C a/b/c/x/y.normal.txt
1269
1270
1270 (3) pattern related to largefiles: no performance boost
1271 (3) pattern related to largefiles: no performance boost
1271 $ hg status -A a/b/c/d
1272 $ hg status -A a/b/c/d
1272 C a/b/c/d/e.large.txt
1273 C a/b/c/d/e.large.txt
1273 C a/b/c/d/e.normal.txt
1274 C a/b/c/d/e.normal.txt
1274
1275
1275 (4) pattern related to STANDIN (not to largefiles): performance boost
1276 (4) pattern related to STANDIN (not to largefiles): performance boost
1276 $ hg status -A .hglf/a
1277 $ hg status -A .hglf/a
1277 C .hglf/a/b/c/d/e.large.txt
1278 C .hglf/a/b/c/d/e.large.txt
1278
1279
1279 (5) mixed case: no performance boost
1280 (5) mixed case: no performance boost
1280 $ hg status -A a/b/c/x a/b/c/d
1281 $ hg status -A a/b/c/x a/b/c/d
1281 C a/b/c/d/e.large.txt
1282 C a/b/c/d/e.large.txt
1282 C a/b/c/d/e.normal.txt
1283 C a/b/c/d/e.normal.txt
1283 C a/b/c/x/y.normal.txt
1284 C a/b/c/x/y.normal.txt
1284
1285
1285 verify that largefiles doesn't break filesets
1286 verify that largefiles doesn't break filesets
1286
1287
1287 $ hg log --rev . --exclude "set:binary()"
1288 $ hg log --rev . --exclude "set:binary()"
1288 changeset: 0:41bd42f10efa
1289 changeset: 0:41bd42f10efa
1289 tag: tip
1290 tag: tip
1290 user: test
1291 user: test
1291 date: Thu Jan 01 00:00:00 1970 +0000
1292 date: Thu Jan 01 00:00:00 1970 +0000
1292 summary: add files
1293 summary: add files
1293
1294
1294 verify that large files in subrepos handled properly
1295 verify that large files in subrepos handled properly
1295 $ hg init subrepo
1296 $ hg init subrepo
1296 $ echo "subrepo = subrepo" > .hgsub
1297 $ echo "subrepo = subrepo" > .hgsub
1297 $ hg add .hgsub
1298 $ hg add .hgsub
1298 $ hg ci -m "add subrepo"
1299 $ hg ci -m "add subrepo"
1299 Invoking status precommit hook
1300 Invoking status precommit hook
1300 A .hgsub
1301 A .hgsub
1301 ? .hgsubstate
1302 ? .hgsubstate
1302 $ echo "rev 1" > subrepo/large.txt
1303 $ echo "rev 1" > subrepo/large.txt
1303 $ hg -R subrepo add --large subrepo/large.txt
1304 $ hg -R subrepo add --large subrepo/large.txt
1304 $ hg sum
1305 $ hg sum
1305 parent: 1:8ee150ea2e9c tip
1306 parent: 1:8ee150ea2e9c tip
1306 add subrepo
1307 add subrepo
1307 branch: default
1308 branch: default
1308 commit: 1 subrepos
1309 commit: 1 subrepos
1309 update: (current)
1310 update: (current)
1310 $ hg st
1311 $ hg st
1311 $ hg st -S
1312 $ hg st -S
1312 A subrepo/large.txt
1313 A subrepo/large.txt
1313 $ hg ci -S -m "commit top repo"
1314 $ hg ci -S -m "commit top repo"
1314 committing subrepository subrepo
1315 committing subrepository subrepo
1315 Invoking status precommit hook
1316 Invoking status precommit hook
1316 A large.txt
1317 A large.txt
1317 Invoking status precommit hook
1318 Invoking status precommit hook
1318 M .hgsubstate
1319 M .hgsubstate
1319 # No differences
1320 # No differences
1320 $ hg st -S
1321 $ hg st -S
1321 $ hg sum
1322 $ hg sum
1322 parent: 2:ce4cd0c527a6 tip
1323 parent: 2:ce4cd0c527a6 tip
1323 commit top repo
1324 commit top repo
1324 branch: default
1325 branch: default
1325 commit: (clean)
1326 commit: (clean)
1326 update: (current)
1327 update: (current)
1327 $ echo "rev 2" > subrepo/large.txt
1328 $ echo "rev 2" > subrepo/large.txt
1328 $ hg st -S
1329 $ hg st -S
1329 M subrepo/large.txt
1330 M subrepo/large.txt
1330 $ hg sum
1331 $ hg sum
1331 parent: 2:ce4cd0c527a6 tip
1332 parent: 2:ce4cd0c527a6 tip
1332 commit top repo
1333 commit top repo
1333 branch: default
1334 branch: default
1334 commit: 1 subrepos
1335 commit: 1 subrepos
1335 update: (current)
1336 update: (current)
1336 $ hg ci -m "this commit should fail without -S"
1337 $ hg ci -m "this commit should fail without -S"
1337 abort: uncommitted changes in subrepo subrepo
1338 abort: uncommitted changes in subrepo subrepo
1338 (use --subrepos for recursive commit)
1339 (use --subrepos for recursive commit)
1339 [255]
1340 [255]
1340
1341
1341 Add a normal file to the subrepo, then test archiving
1342 Add a normal file to the subrepo, then test archiving
1342
1343
1343 $ echo 'normal file' > subrepo/normal.txt
1344 $ echo 'normal file' > subrepo/normal.txt
1344 $ hg -R subrepo add subrepo/normal.txt
1345 $ hg -R subrepo add subrepo/normal.txt
1345
1346
1346 Lock in subrepo, otherwise the change isn't archived
1347 Lock in subrepo, otherwise the change isn't archived
1347
1348
1348 $ hg ci -S -m "add normal file to top level"
1349 $ hg ci -S -m "add normal file to top level"
1349 committing subrepository subrepo
1350 committing subrepository subrepo
1350 Invoking status precommit hook
1351 Invoking status precommit hook
1351 M large.txt
1352 M large.txt
1352 A normal.txt
1353 A normal.txt
1353 Invoking status precommit hook
1354 Invoking status precommit hook
1354 M .hgsubstate
1355 M .hgsubstate
1355 $ hg archive -S lf_subrepo_archive
1356 $ hg archive -S lf_subrepo_archive
1356 $ find lf_subrepo_archive | sort
1357 $ find lf_subrepo_archive | sort
1357 lf_subrepo_archive
1358 lf_subrepo_archive
1358 lf_subrepo_archive/.hg_archival.txt
1359 lf_subrepo_archive/.hg_archival.txt
1359 lf_subrepo_archive/.hgsub
1360 lf_subrepo_archive/.hgsub
1360 lf_subrepo_archive/.hgsubstate
1361 lf_subrepo_archive/.hgsubstate
1361 lf_subrepo_archive/a
1362 lf_subrepo_archive/a
1362 lf_subrepo_archive/a/b
1363 lf_subrepo_archive/a/b
1363 lf_subrepo_archive/a/b/c
1364 lf_subrepo_archive/a/b/c
1364 lf_subrepo_archive/a/b/c/d
1365 lf_subrepo_archive/a/b/c/d
1365 lf_subrepo_archive/a/b/c/d/e.large.txt
1366 lf_subrepo_archive/a/b/c/d/e.large.txt
1366 lf_subrepo_archive/a/b/c/d/e.normal.txt
1367 lf_subrepo_archive/a/b/c/d/e.normal.txt
1367 lf_subrepo_archive/a/b/c/x
1368 lf_subrepo_archive/a/b/c/x
1368 lf_subrepo_archive/a/b/c/x/y.normal.txt
1369 lf_subrepo_archive/a/b/c/x/y.normal.txt
1369 lf_subrepo_archive/subrepo
1370 lf_subrepo_archive/subrepo
1370 lf_subrepo_archive/subrepo/large.txt
1371 lf_subrepo_archive/subrepo/large.txt
1371 lf_subrepo_archive/subrepo/normal.txt
1372 lf_subrepo_archive/subrepo/normal.txt
1372
1373
1373 $ cd ..
1374 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now