##// END OF EJS Templates
largefiles: check file in the repo store before checking remotely (issue5257)...
liscju -
r29421:ecbbf4d5 default
parent child Browse files
Show More
@@ -1,63 +1,66
1 1 # Copyright 2009-2010 Gregory P. Ward
2 2 # Copyright 2009-2010 Intelerad Medical Systems Incorporated
3 3 # Copyright 2010-2011 Fog Creek Software
4 4 # Copyright 2010-2011 Unity Technologies
5 5 #
6 6 # This software may be used and distributed according to the terms of the
7 7 # GNU General Public License version 2 or any later version.
8 8
9 9 '''store class for local filesystem'''
10 10 from __future__ import absolute_import
11 11
12 12 from mercurial.i18n import _
13 13
14 14 from . import (
15 15 basestore,
16 16 lfutil,
17 17 )
18 18
19 19 class localstore(basestore.basestore):
20 20 '''localstore first attempts to grab files out of the store in the remote
21 21 Mercurial repository. Failing that, it attempts to grab the files from
22 22 the user cache.'''
23 23
24 24 def __init__(self, ui, repo, remote):
25 25 self.remote = remote.local()
26 26 super(localstore, self).__init__(ui, repo, self.remote.url())
27 27
28 28 def put(self, source, hash):
29 29 if lfutil.instore(self.remote, hash):
30 30 return
31 31 lfutil.link(source, lfutil.storepath(self.remote, hash))
32 32
33 33 def exists(self, hashes):
34 34 retval = {}
35 35 for hash in hashes:
36 36 retval[hash] = lfutil.instore(self.remote, hash)
37 37 return retval
38 38
39 39 def _getfile(self, tmpfile, filename, hash):
40 40 path = lfutil.findfile(self.remote, hash)
41 41 if not path:
42 42 raise basestore.StoreError(filename, hash, self.url,
43 43 _("can't get file locally"))
44 44 with open(path, 'rb') as fd:
45 45 return lfutil.copyandhash(fd, tmpfile)
46 46
47 47 def _verifyfiles(self, contents, filestocheck):
48 48 failed = False
49 49 for cset, filename, expectedhash in filestocheck:
50 storepath, exists = lfutil.findstorepath(self.remote, expectedhash)
50 storepath, exists = lfutil.findstorepath(self.repo, expectedhash)
51 if not exists:
52 storepath, exists = lfutil.findstorepath(
53 self.remote, expectedhash)
51 54 if not exists:
52 55 self.ui.warn(
53 56 _('changeset %s: %s references missing %s\n')
54 57 % (cset, filename, storepath))
55 58 failed = True
56 59 elif contents:
57 60 actualhash = lfutil.hashfile(storepath)
58 61 if actualhash != expectedhash:
59 62 self.ui.warn(
60 63 _('changeset %s: %s references corrupted %s\n')
61 64 % (cset, filename, storepath))
62 65 failed = True
63 66 return failed
@@ -1,439 +1,447
1 1 This file contains testcases that tend to be related to the wire protocol part
2 2 of largefiles.
3 3
4 4 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
5 5 $ mkdir "${USERCACHE}"
6 6 $ cat >> $HGRCPATH <<EOF
7 7 > [extensions]
8 8 > largefiles=
9 9 > purge=
10 10 > rebase=
11 11 > transplant=
12 12 > [phases]
13 13 > publish=False
14 14 > [largefiles]
15 15 > minsize=2
16 16 > patterns=glob:**.dat
17 17 > usercache=${USERCACHE}
18 18 > [web]
19 19 > allow_archive = zip
20 20 > [hooks]
21 21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 22 > EOF
23 23
24 24
25 25 #if serve
26 26 vanilla clients not locked out from largefiles servers on vanilla repos
27 27 $ mkdir r1
28 28 $ cd r1
29 29 $ hg init
30 30 $ echo c1 > f1
31 31 $ hg add f1
32 32 $ hg commit -m "m1"
33 33 Invoking status precommit hook
34 34 A f1
35 35 $ cd ..
36 36 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
37 37 $ cat hg.pid >> $DAEMON_PIDS
38 38 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
39 39 requesting all changes
40 40 adding changesets
41 41 adding manifests
42 42 adding file changes
43 43 added 1 changesets with 1 changes to 1 files
44 44 updating to branch default
45 45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 46
47 47 largefiles clients still work with vanilla servers
48 48 $ hg serve --config extensions.largefiles=! -R r1 -d -p $HGPORT1 --pid-file hg.pid
49 49 $ cat hg.pid >> $DAEMON_PIDS
50 50 $ hg clone http://localhost:$HGPORT1 r3
51 51 requesting all changes
52 52 adding changesets
53 53 adding manifests
54 54 adding file changes
55 55 added 1 changesets with 1 changes to 1 files
56 56 updating to branch default
57 57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 58 #endif
59 59
60 60 vanilla clients locked out from largefiles http repos
61 61 $ mkdir r4
62 62 $ cd r4
63 63 $ hg init
64 64 $ echo c1 > f1
65 65 $ hg add --large f1
66 66 $ hg commit -m "m1"
67 67 Invoking status precommit hook
68 68 A f1
69 69 $ cd ..
70 70
71 71 largefiles can be pushed locally (issue3583)
72 72 $ hg init dest
73 73 $ cd r4
74 74 $ hg outgoing ../dest
75 75 comparing with ../dest
76 76 searching for changes
77 77 changeset: 0:639881c12b4c
78 78 tag: tip
79 79 user: test
80 80 date: Thu Jan 01 00:00:00 1970 +0000
81 81 summary: m1
82 82
83 83 $ hg push ../dest
84 84 pushing to ../dest
85 85 searching for changes
86 86 adding changesets
87 87 adding manifests
88 88 adding file changes
89 89 added 1 changesets with 1 changes to 1 files
90 90
91 91 exit code with nothing outgoing (issue3611)
92 92 $ hg outgoing ../dest
93 93 comparing with ../dest
94 94 searching for changes
95 95 no changes found
96 96 [1]
97 97 $ cd ..
98 98
99 99 #if serve
100 100 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
101 101 $ cat hg.pid >> $DAEMON_PIDS
102 102 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
103 103 abort: remote error:
104 104
105 105 This repository uses the largefiles extension.
106 106
107 107 Please enable it in your Mercurial config file.
108 108 [255]
109 109
110 110 used all HGPORTs, kill all daemons
111 111 $ killdaemons.py
112 112 #endif
113 113
114 114 vanilla clients locked out from largefiles ssh repos
115 115 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
116 116 remote:
117 117 remote: This repository uses the largefiles extension.
118 118 remote:
119 119 remote: Please enable it in your Mercurial config file.
120 120 remote:
121 121 remote: -
122 122 abort: remote error
123 123 (check previous remote output)
124 124 [255]
125 125
126 126 #if serve
127 127
128 128 largefiles clients refuse to push largefiles repos to vanilla servers
129 129 $ mkdir r6
130 130 $ cd r6
131 131 $ hg init
132 132 $ echo c1 > f1
133 133 $ hg add f1
134 134 $ hg commit -m "m1"
135 135 Invoking status precommit hook
136 136 A f1
137 137 $ cat >> .hg/hgrc <<!
138 138 > [web]
139 139 > push_ssl = false
140 140 > allow_push = *
141 141 > !
142 142 $ cd ..
143 143 $ hg clone r6 r7
144 144 updating to branch default
145 145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 146 $ cd r7
147 147 $ echo c2 > f2
148 148 $ hg add --large f2
149 149 $ hg commit -m "m2"
150 150 Invoking status precommit hook
151 151 A f2
152 $ hg verify --large
153 checking changesets
154 checking manifests
155 crosschecking files in changesets and manifests
156 checking files
157 2 files, 2 changesets, 2 total revisions
158 searching 1 changesets for largefiles
159 verified existence of 1 revisions of 1 largefiles
152 160 $ hg serve --config extensions.largefiles=! -R ../r6 -d -p $HGPORT --pid-file ../hg.pid
153 161 $ cat ../hg.pid >> $DAEMON_PIDS
154 162 $ hg push http://localhost:$HGPORT
155 163 pushing to http://localhost:$HGPORT/
156 164 searching for changes
157 165 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
158 166 [255]
159 167 $ cd ..
160 168
161 169 putlfile errors are shown (issue3123)
162 170 Corrupt the cached largefile in r7 and move it out of the servers usercache
163 171 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
164 172 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
165 173 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
166 174 $ hg init empty
167 175 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
168 176 > --config 'web.allow_push=*' --config web.push_ssl=False
169 177 $ cat hg.pid >> $DAEMON_PIDS
170 178 $ hg push -R r7 http://localhost:$HGPORT1
171 179 pushing to http://localhost:$HGPORT1/
172 180 searching for changes
173 181 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
174 182 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
175 183 [255]
176 184 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
177 185 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
178 186 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
179 187 $ hg push -R r7 http://localhost:$HGPORT1
180 188 pushing to http://localhost:$HGPORT1/
181 189 searching for changes
182 190 remote: adding changesets
183 191 remote: adding manifests
184 192 remote: adding file changes
185 193 remote: added 2 changesets with 2 changes to 2 files
186 194 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
187 195 server side corruption
188 196 $ rm -rf empty
189 197
190 198 Push a largefiles repository to a served empty repository
191 199 $ hg init r8
192 200 $ echo c3 > r8/f1
193 201 $ hg add --large r8/f1 -R r8
194 202 $ hg commit -m "m1" -R r8
195 203 Invoking status precommit hook
196 204 A f1
197 205 $ hg init empty
198 206 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
199 207 > --config 'web.allow_push=*' --config web.push_ssl=False
200 208 $ cat hg.pid >> $DAEMON_PIDS
201 209 $ rm "${USERCACHE}"/*
202 210 $ hg push -R r8 http://localhost:$HGPORT2/#default
203 211 pushing to http://localhost:$HGPORT2/
204 212 searching for changes
205 213 remote: adding changesets
206 214 remote: adding manifests
207 215 remote: adding file changes
208 216 remote: added 1 changesets with 1 changes to 1 files
209 217 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
210 218 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
211 219
212 220 Clone over http, no largefiles pulled on clone.
213 221
214 222 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
215 223 adding changesets
216 224 adding manifests
217 225 adding file changes
218 226 added 1 changesets with 1 changes to 1 files
219 227
220 228 Archive contains largefiles
221 229 >>> import urllib2, os
222 230 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2']
223 231 >>> with open('archive.zip', 'w') as f:
224 232 ... f.write(urllib2.urlopen(u).read())
225 233 $ unzip -t archive.zip
226 234 Archive: archive.zip
227 235 testing: empty-default/.hg_archival.txt OK
228 236 testing: empty-default/f1 OK
229 237 No errors detected in compressed data of archive.zip.
230 238
231 239 test 'verify' with remotestore:
232 240
233 241 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
234 242 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
235 243 $ hg -R http-clone verify --large --lfa
236 244 checking changesets
237 245 checking manifests
238 246 crosschecking files in changesets and manifests
239 247 checking files
240 248 1 files, 1 changesets, 1 total revisions
241 249 searching 1 changesets for largefiles
242 250 changeset 0:cf03e5bb9936: f1 missing
243 251 verified existence of 1 revisions of 1 largefiles
244 252 [1]
245 253 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
246 254 $ hg -R http-clone -q verify --large --lfa
247 255
248 256 largefiles pulled on update - a largefile missing on the server:
249 257 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
250 258 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
251 259 getting changed largefiles
252 260 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
253 261 0 largefiles updated, 0 removed
254 262 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 263 $ hg -R http-clone st
256 264 ! f1
257 265 $ hg -R http-clone up -Cqr null
258 266
259 267 largefiles pulled on update - a largefile corrupted on the server:
260 268 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
261 269 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
262 270 getting changed largefiles
263 271 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
264 272 0 largefiles updated, 0 removed
265 273 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 274 $ hg -R http-clone st
267 275 ! f1
268 276 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
269 277 $ [ ! -f http-clone/f1 ]
270 278 $ [ ! -f http-clone-usercache ]
271 279 $ hg -R http-clone verify --large --lfc
272 280 checking changesets
273 281 checking manifests
274 282 crosschecking files in changesets and manifests
275 283 checking files
276 284 1 files, 1 changesets, 1 total revisions
277 285 searching 1 changesets for largefiles
278 286 verified contents of 1 revisions of 1 largefiles
279 287 $ hg -R http-clone up -Cqr null
280 288
281 289 largefiles pulled on update - no server side problems:
282 290 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
283 291 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache --config progress.debug=true
284 292 resolving manifests
285 293 branchmerge: False, force: False, partial: False
286 294 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
287 295 .hglf/f1: remote created -> g
288 296 getting .hglf/f1
289 297 updating: .hglf/f1 1/1 files (100.00%)
290 298 getting changed largefiles
291 299 using http://localhost:$HGPORT2/
292 300 sending capabilities command
293 301 sending batch command
294 302 getting largefiles: 0/1 files (0.00%)
295 303 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
296 304 sending getlfile command
297 305 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
298 306 1 largefiles updated, 0 removed
299 307 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
300 308
301 309 $ ls http-clone-usercache/*
302 310 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
303 311
304 312 $ rm -rf empty http-clone*
305 313
306 314 used all HGPORTs, kill all daemons
307 315 $ killdaemons.py
308 316
309 317 largefiles should batch verify remote calls
310 318
311 319 $ hg init batchverifymain
312 320 $ cd batchverifymain
313 321 $ echo "aaa" >> a
314 322 $ hg add --large a
315 323 $ hg commit -m "a"
316 324 Invoking status precommit hook
317 325 A a
318 326 $ echo "bbb" >> b
319 327 $ hg add --large b
320 328 $ hg commit -m "b"
321 329 Invoking status precommit hook
322 330 A b
323 331 $ cd ..
324 332 $ hg serve -R batchverifymain -d -p $HGPORT --pid-file hg.pid \
325 333 > -A access.log
326 334 $ cat hg.pid >> $DAEMON_PIDS
327 335 $ hg clone --noupdate http://localhost:$HGPORT batchverifyclone
328 336 requesting all changes
329 337 adding changesets
330 338 adding manifests
331 339 adding file changes
332 340 added 2 changesets with 2 changes to 2 files
333 341 $ hg -R batchverifyclone verify --large --lfa
334 342 checking changesets
335 343 checking manifests
336 344 crosschecking files in changesets and manifests
337 345 checking files
338 346 2 files, 2 changesets, 2 total revisions
339 347 searching 2 changesets for largefiles
340 348 verified existence of 2 revisions of 2 largefiles
341 349 $ tail -1 access.log
342 350 127.0.0.1 - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a (glob)
343 351 $ hg -R batchverifyclone update
344 352 getting changed largefiles
345 353 2 largefiles updated, 0 removed
346 354 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
347 355
348 356 Clear log file before next test
349 357
350 358 $ printf "" > access.log
351 359
352 360 Verify should check file on remote server only when file is not
353 361 available locally.
354 362
355 363 $ echo "ccc" >> batchverifymain/c
356 364 $ hg -R batchverifymain status
357 365 ? c
358 366 $ hg -R batchverifymain add --large batchverifymain/c
359 367 $ hg -R batchverifymain commit -m "c"
360 368 Invoking status precommit hook
361 369 A c
362 370 $ hg -R batchverifyclone pull
363 371 pulling from http://localhost:$HGPORT/
364 372 searching for changes
365 373 adding changesets
366 374 adding manifests
367 375 adding file changes
368 376 added 1 changesets with 1 changes to 1 files
369 377 (run 'hg update' to get a working copy)
370 378 $ hg -R batchverifyclone verify --lfa
371 379 checking changesets
372 380 checking manifests
373 381 crosschecking files in changesets and manifests
374 382 checking files
375 383 3 files, 3 changesets, 3 total revisions
376 384 searching 3 changesets for largefiles
377 385 verified existence of 3 revisions of 3 largefiles
378 386 $ tail -1 access.log
379 387 127.0.0.1 - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c (glob)
380 388
381 389 $ killdaemons.py
382 390
383 391 largefiles should not ask for password again after succesfull authorization
384 392
385 393 $ hg init credentialmain
386 394 $ cd credentialmain
387 395 $ echo "aaa" >> a
388 396 $ hg add --large a
389 397 $ hg commit -m "a"
390 398 Invoking status precommit hook
391 399 A a
392 400
393 401 Before running server clear the user cache to force clone to download
394 402 a large file from the server rather than to get it from the cache
395 403
396 404 $ rm "${USERCACHE}"/*
397 405
398 406 $ cd ..
399 407 $ cat << EOT > userpass.py
400 408 > import base64
401 409 > from mercurial.hgweb import common
402 410 > def perform_authentication(hgweb, req, op):
403 411 > auth = req.env.get('HTTP_AUTHORIZATION')
404 412 > if not auth:
405 413 > raise common.ErrorResponse(common.HTTP_UNAUTHORIZED, 'who',
406 414 > [('WWW-Authenticate', 'Basic Realm="mercurial"')])
407 415 > if base64.b64decode(auth.split()[1]).split(':', 1) != ['user', 'pass']:
408 416 > raise common.ErrorResponse(common.HTTP_FORBIDDEN, 'no')
409 417 > def extsetup():
410 418 > common.permhooks.insert(0, perform_authentication)
411 419 > EOT
412 420 $ hg serve --config extensions.x=userpass.py -R credentialmain \
413 421 > -d -p $HGPORT --pid-file hg.pid -A access.log
414 422 $ cat hg.pid >> $DAEMON_PIDS
415 423 $ cat << EOF > get_pass.py
416 424 > import getpass
417 425 > def newgetpass(arg):
418 426 > return "pass"
419 427 > getpass.getpass = newgetpass
420 428 > EOF
421 429 $ hg clone --config ui.interactive=true --config extensions.getpass=get_pass.py \
422 430 > http://user@localhost:$HGPORT credentialclone
423 431 requesting all changes
424 432 http authorization required for http://localhost:$HGPORT/
425 433 realm: mercurial
426 434 user: user
427 435 password: adding changesets
428 436 adding manifests
429 437 adding file changes
430 438 added 1 changesets with 1 changes to 1 files
431 439 updating to branch default
432 440 getting changed largefiles
433 441 1 largefiles updated, 0 removed
434 442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 443
436 444 $ rm hg.pid access.log
437 445 $ killdaemons.py
438 446
439 447 #endif
@@ -1,1862 +1,1866
1 1 This file used to contains all largefile tests.
2 2 Do not add any new tests in this file as it his already far too long to run.
3 3
4 4 It contains all the testing of the basic concepts of large file in a single block.
5 5
6 6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 7 $ mkdir "${USERCACHE}"
8 8 $ cat >> $HGRCPATH <<EOF
9 9 > [extensions]
10 10 > largefiles=
11 11 > purge=
12 12 > rebase=
13 13 > transplant=
14 14 > [phases]
15 15 > publish=False
16 16 > [largefiles]
17 17 > minsize=2
18 18 > patterns=glob:**.dat
19 19 > usercache=${USERCACHE}
20 20 > [hooks]
21 21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 22 > [experimental]
23 23 > # drop me once bundle2 is the default,
24 24 > # added to get test change early.
25 25 > bundle2-exp = True
26 26 > EOF
27 27
28 28 Create the repo with a couple of revisions of both large and normal
29 29 files.
30 30 Test status and dirstate of largefiles and that summary output is correct.
31 31
32 32 $ hg init a
33 33 $ cd a
34 34 $ mkdir sub
35 35 $ echo normal1 > normal1
36 36 $ echo normal2 > sub/normal2
37 37 $ echo large1 > large1
38 38 $ echo large2 > sub/large2
39 39 $ hg add normal1 sub/normal2
40 40 $ hg add --large large1 sub/large2
41 41 $ hg commit -m "add files"
42 42 Invoking status precommit hook
43 43 A large1
44 44 A normal1
45 45 A sub/large2
46 46 A sub/normal2
47 47 $ touch large1 sub/large2
48 48 $ sleep 1
49 49 $ hg st
50 50 $ hg debugstate --nodates
51 51 n 644 41 set .hglf/large1
52 52 n 644 41 set .hglf/sub/large2
53 53 n 644 8 set normal1
54 54 n 644 8 set sub/normal2
55 55 $ hg debugstate --large --nodates
56 56 n 644 7 set large1
57 57 n 644 7 set sub/large2
58 58 $ echo normal11 > normal1
59 59 $ echo normal22 > sub/normal2
60 60 $ echo large11 > large1
61 61 $ echo large22 > sub/large2
62 62 $ hg commit -m "edit files"
63 63 Invoking status precommit hook
64 64 M large1
65 65 M normal1
66 66 M sub/large2
67 67 M sub/normal2
68 68 $ hg sum --large
69 69 parent: 1:ce8896473775 tip
70 70 edit files
71 71 branch: default
72 72 commit: (clean)
73 73 update: (current)
74 74 phases: 2 draft
75 75 largefiles: (no remote repo)
76 76
77 77 Commit preserved largefile contents.
78 78
79 79 $ cat normal1
80 80 normal11
81 81 $ cat large1
82 82 large11
83 83 $ cat sub/normal2
84 84 normal22
85 85 $ cat sub/large2
86 86 large22
87 87
88 88 Test status, subdir and unknown files
89 89
90 90 $ echo unknown > sub/unknown
91 91 $ hg st --all
92 92 ? sub/unknown
93 93 C large1
94 94 C normal1
95 95 C sub/large2
96 96 C sub/normal2
97 97 $ hg st --all sub
98 98 ? sub/unknown
99 99 C sub/large2
100 100 C sub/normal2
101 101 $ rm sub/unknown
102 102
103 103 Test messages and exit codes for remove warning cases
104 104
105 105 $ hg remove -A large1
106 106 not removing large1: file still exists
107 107 [1]
108 108 $ echo 'modified' > large1
109 109 $ hg remove large1
110 110 not removing large1: file is modified (use -f to force removal)
111 111 [1]
112 112 $ echo 'new' > normalnew
113 113 $ hg add normalnew
114 114 $ echo 'new' > largenew
115 115 $ hg add --large normalnew
116 116 normalnew already tracked!
117 117 $ hg remove normalnew largenew
118 118 not removing largenew: file is untracked
119 119 not removing normalnew: file has been marked for add (use forget to undo)
120 120 [1]
121 121 $ rm normalnew largenew
122 122 $ hg up -Cq
123 123
124 124 Remove both largefiles and normal files.
125 125
126 126 $ hg remove normal1 large1
127 127 $ hg status large1
128 128 R large1
129 129 $ hg commit -m "remove files"
130 130 Invoking status precommit hook
131 131 R large1
132 132 R normal1
133 133 $ ls
134 134 sub
135 135 $ echo "testlargefile" > large1-test
136 136 $ hg add --large large1-test
137 137 $ hg st
138 138 A large1-test
139 139 $ hg rm large1-test
140 140 not removing large1-test: file has been marked for add (use forget to undo)
141 141 [1]
142 142 $ hg st
143 143 A large1-test
144 144 $ hg forget large1-test
145 145 $ hg st
146 146 ? large1-test
147 147 $ hg remove large1-test
148 148 not removing large1-test: file is untracked
149 149 [1]
150 150 $ hg forget large1-test
151 151 not removing large1-test: file is already untracked
152 152 [1]
153 153 $ rm large1-test
154 154
155 155 Copy both largefiles and normal files (testing that status output is correct).
156 156
157 157 $ hg cp sub/normal2 normal1
158 158 $ hg cp sub/large2 large1
159 159 $ hg commit -m "copy files"
160 160 Invoking status precommit hook
161 161 A large1
162 162 A normal1
163 163 $ cat normal1
164 164 normal22
165 165 $ cat large1
166 166 large22
167 167
168 168 Test moving largefiles and verify that normal files are also unaffected.
169 169
170 170 $ hg mv normal1 normal3
171 171 $ hg mv large1 large3
172 172 $ hg mv sub/normal2 sub/normal4
173 173 $ hg mv sub/large2 sub/large4
174 174 $ hg commit -m "move files"
175 175 Invoking status precommit hook
176 176 A large3
177 177 A normal3
178 178 A sub/large4
179 179 A sub/normal4
180 180 R large1
181 181 R normal1
182 182 R sub/large2
183 183 R sub/normal2
184 184 $ cat normal3
185 185 normal22
186 186 $ cat large3
187 187 large22
188 188 $ cat sub/normal4
189 189 normal22
190 190 $ cat sub/large4
191 191 large22
192 192
193 193
194 194 #if serve
195 195 Test display of largefiles in hgweb
196 196
197 197 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
198 198 $ cat ../hg.pid >> $DAEMON_PIDS
199 199 $ get-with-headers.py 127.0.0.1:$HGPORT 'file/tip/?style=raw'
200 200 200 Script output follows
201 201
202 202
203 203 drwxr-xr-x sub
204 204 -rw-r--r-- 41 large3
205 205 -rw-r--r-- 9 normal3
206 206
207 207
208 208 $ get-with-headers.py 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
209 209 200 Script output follows
210 210
211 211
212 212 -rw-r--r-- 41 large4
213 213 -rw-r--r-- 9 normal4
214 214
215 215
216 216 $ killdaemons.py
217 217 #endif
218 218
219 219 Test archiving the various revisions. These hit corner cases known with
220 220 archiving.
221 221
222 222 $ hg archive -r 0 ../archive0
223 223 $ hg archive -r 1 ../archive1
224 224 $ hg archive -r 2 ../archive2
225 225 $ hg archive -r 3 ../archive3
226 226 $ hg archive -r 4 ../archive4
227 227 $ cd ../archive0
228 228 $ cat normal1
229 229 normal1
230 230 $ cat large1
231 231 large1
232 232 $ cat sub/normal2
233 233 normal2
234 234 $ cat sub/large2
235 235 large2
236 236 $ cd ../archive1
237 237 $ cat normal1
238 238 normal11
239 239 $ cat large1
240 240 large11
241 241 $ cat sub/normal2
242 242 normal22
243 243 $ cat sub/large2
244 244 large22
245 245 $ cd ../archive2
246 246 $ ls
247 247 sub
248 248 $ cat sub/normal2
249 249 normal22
250 250 $ cat sub/large2
251 251 large22
252 252 $ cd ../archive3
253 253 $ cat normal1
254 254 normal22
255 255 $ cat large1
256 256 large22
257 257 $ cat sub/normal2
258 258 normal22
259 259 $ cat sub/large2
260 260 large22
261 261 $ cd ../archive4
262 262 $ cat normal3
263 263 normal22
264 264 $ cat large3
265 265 large22
266 266 $ cat sub/normal4
267 267 normal22
268 268 $ cat sub/large4
269 269 large22
270 270
271 271 Commit corner case: specify files to commit.
272 272
273 273 $ cd ../a
274 274 $ echo normal3 > normal3
275 275 $ echo large3 > large3
276 276 $ echo normal4 > sub/normal4
277 277 $ echo large4 > sub/large4
278 278 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
279 279 Invoking status precommit hook
280 280 M large3
281 281 M normal3
282 282 M sub/large4
283 283 M sub/normal4
284 284 $ cat normal3
285 285 normal3
286 286 $ cat large3
287 287 large3
288 288 $ cat sub/normal4
289 289 normal4
290 290 $ cat sub/large4
291 291 large4
292 292
293 293 One more commit corner case: commit from a subdirectory.
294 294
295 295 $ cd ../a
296 296 $ echo normal33 > normal3
297 297 $ echo large33 > large3
298 298 $ echo normal44 > sub/normal4
299 299 $ echo large44 > sub/large4
300 300 $ cd sub
301 301 $ hg commit -m "edit files yet again"
302 302 Invoking status precommit hook
303 303 M large3
304 304 M normal3
305 305 M sub/large4
306 306 M sub/normal4
307 307 $ cat ../normal3
308 308 normal33
309 309 $ cat ../large3
310 310 large33
311 311 $ cat normal4
312 312 normal44
313 313 $ cat large4
314 314 large44
315 315
316 316 Committing standins is not allowed.
317 317
318 318 $ cd ..
319 319 $ echo large3 > large3
320 320 $ hg commit .hglf/large3 -m "try to commit standin"
321 321 abort: file ".hglf/large3" is a largefile standin
322 322 (commit the largefile itself instead)
323 323 [255]
324 324
325 325 Corner cases for adding largefiles.
326 326
327 327 $ echo large5 > large5
328 328 $ hg add --large large5
329 329 $ hg add --large large5
330 330 large5 already a largefile
331 331 $ mkdir sub2
332 332 $ echo large6 > sub2/large6
333 333 $ echo large7 > sub2/large7
334 334 $ hg add --large sub2
335 335 adding sub2/large6 as a largefile (glob)
336 336 adding sub2/large7 as a largefile (glob)
337 337 $ hg st
338 338 M large3
339 339 A large5
340 340 A sub2/large6
341 341 A sub2/large7
342 342
343 343 Committing directories containing only largefiles.
344 344
345 345 $ mkdir -p z/y/x/m
346 346 $ touch z/y/x/m/large1
347 347 $ touch z/y/x/large2
348 348 $ hg add --large z/y/x/m/large1 z/y/x/large2
349 349 $ hg commit -m "Subdir with directory only containing largefiles" z
350 350 Invoking status precommit hook
351 351 M large3
352 352 A large5
353 353 A sub2/large6
354 354 A sub2/large7
355 355 A z/y/x/large2
356 356 A z/y/x/m/large1
357 357
358 358 (and a bit of log testing)
359 359
360 360 $ hg log -T '{rev}\n' z/y/x/m/large1
361 361 7
362 362 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
363 363 7
364 364
365 365 $ hg rollback --quiet
366 366 $ touch z/y/x/m/normal
367 367 $ hg add z/y/x/m/normal
368 368 $ hg commit -m "Subdir with mixed contents" z
369 369 Invoking status precommit hook
370 370 M large3
371 371 A large5
372 372 A sub2/large6
373 373 A sub2/large7
374 374 A z/y/x/large2
375 375 A z/y/x/m/large1
376 376 A z/y/x/m/normal
377 377 $ hg st
378 378 M large3
379 379 A large5
380 380 A sub2/large6
381 381 A sub2/large7
382 382 $ hg rollback --quiet
383 383 $ hg revert z/y/x/large2 z/y/x/m/large1
384 384 $ rm z/y/x/large2 z/y/x/m/large1
385 385 $ hg commit -m "Subdir with normal contents" z
386 386 Invoking status precommit hook
387 387 M large3
388 388 A large5
389 389 A sub2/large6
390 390 A sub2/large7
391 391 A z/y/x/m/normal
392 392 $ hg st
393 393 M large3
394 394 A large5
395 395 A sub2/large6
396 396 A sub2/large7
397 397 $ hg rollback --quiet
398 398 $ hg revert --quiet z
399 399 $ hg commit -m "Empty subdir" z
400 400 abort: z: no match under directory!
401 401 [255]
402 402 $ rm -rf z
403 403 $ hg ci -m "standin" .hglf
404 404 abort: file ".hglf" is a largefile standin
405 405 (commit the largefile itself instead)
406 406 [255]
407 407
408 408 Test "hg status" with combination of 'file pattern' and 'directory
409 409 pattern' for largefiles:
410 410
411 411 $ hg status sub2/large6 sub2
412 412 A sub2/large6
413 413 A sub2/large7
414 414
415 415 Config settings (pattern **.dat, minsize 2 MB) are respected.
416 416
417 417 $ echo testdata > test.dat
418 418 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
419 419 $ hg add
420 420 adding reallylarge as a largefile
421 421 adding test.dat as a largefile
422 422
423 423 Test that minsize and --lfsize handle float values;
424 424 also tests that --lfsize overrides largefiles.minsize.
425 425 (0.250 MB = 256 kB = 262144 B)
426 426
427 427 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
428 428 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
429 429 $ hg --config largefiles.minsize=.25 add
430 430 adding ratherlarge as a largefile
431 431 adding medium
432 432 $ hg forget medium
433 433 $ hg --config largefiles.minsize=.25 add --lfsize=.125
434 434 adding medium as a largefile
435 435 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
436 436 $ hg --config largefiles.minsize=.25 add --lfsize=.125
437 437 adding notlarge
438 438 $ hg forget notlarge
439 439
440 440 Test forget on largefiles.
441 441
442 442 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
443 443 $ hg commit -m "add/edit more largefiles"
444 444 Invoking status precommit hook
445 445 A sub2/large6
446 446 A sub2/large7
447 447 R large3
448 448 ? large5
449 449 ? medium
450 450 ? notlarge
451 451 ? ratherlarge
452 452 ? reallylarge
453 453 ? test.dat
454 454 $ hg st
455 455 ? large3
456 456 ? large5
457 457 ? medium
458 458 ? notlarge
459 459 ? ratherlarge
460 460 ? reallylarge
461 461 ? test.dat
462 462
463 463 Purge with largefiles: verify that largefiles are still in the working
464 464 dir after a purge.
465 465
466 466 $ hg purge --all
467 467 $ cat sub/large4
468 468 large44
469 469 $ cat sub2/large6
470 470 large6
471 471 $ cat sub2/large7
472 472 large7
473 473
474 474 Test addremove: verify that files that should be added as largefiles are added as
475 475 such and that already-existing largefiles are not added as normal files by
476 476 accident.
477 477
478 478 $ rm normal3
479 479 $ rm sub/large4
480 480 $ echo "testing addremove with patterns" > testaddremove.dat
481 481 $ echo "normaladdremove" > normaladdremove
482 482 $ hg addremove
483 483 removing sub/large4
484 484 adding testaddremove.dat as a largefile
485 485 removing normal3
486 486 adding normaladdremove
487 487
488 488 Test addremove with -R
489 489
490 490 $ hg up -C
491 491 getting changed largefiles
492 492 1 largefiles updated, 0 removed
493 493 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
494 494 $ rm normal3
495 495 $ rm sub/large4
496 496 $ echo "testing addremove with patterns" > testaddremove.dat
497 497 $ echo "normaladdremove" > normaladdremove
498 498 $ cd ..
499 499 $ hg -R a -v addremove
500 500 removing sub/large4
501 501 adding testaddremove.dat as a largefile
502 502 removing normal3
503 503 adding normaladdremove
504 504 $ cd a
505 505
506 506 Test 3364
507 507 $ hg clone . ../addrm
508 508 updating to branch default
509 509 getting changed largefiles
510 510 3 largefiles updated, 0 removed
511 511 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 512 $ cd ../addrm
513 513 $ cat >> .hg/hgrc <<EOF
514 514 > [hooks]
515 515 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
516 516 > EOF
517 517 $ touch foo
518 518 $ hg add --large foo
519 519 $ hg ci -m "add foo"
520 520 Invoking status precommit hook
521 521 A foo
522 522 Invoking status postcommit hook
523 523 C foo
524 524 C normal3
525 525 C sub/large4
526 526 C sub/normal4
527 527 C sub2/large6
528 528 C sub2/large7
529 529 $ rm foo
530 530 $ hg st
531 531 ! foo
532 532 hmm.. no precommit invoked, but there is a postcommit??
533 533 $ hg ci -m "will not checkin"
534 534 nothing changed (1 missing files, see 'hg status')
535 535 Invoking status postcommit hook
536 536 ! foo
537 537 C normal3
538 538 C sub/large4
539 539 C sub/normal4
540 540 C sub2/large6
541 541 C sub2/large7
542 542 [1]
543 543 $ hg addremove
544 544 removing foo
545 545 $ hg st
546 546 R foo
547 547 $ hg ci -m "used to say nothing changed"
548 548 Invoking status precommit hook
549 549 R foo
550 550 Invoking status postcommit hook
551 551 C normal3
552 552 C sub/large4
553 553 C sub/normal4
554 554 C sub2/large6
555 555 C sub2/large7
556 556 $ hg st
557 557
558 558 Test 3507 (both normal files and largefiles were a problem)
559 559
560 560 $ touch normal
561 561 $ touch large
562 562 $ hg add normal
563 563 $ hg add --large large
564 564 $ hg ci -m "added"
565 565 Invoking status precommit hook
566 566 A large
567 567 A normal
568 568 Invoking status postcommit hook
569 569 C large
570 570 C normal
571 571 C normal3
572 572 C sub/large4
573 573 C sub/normal4
574 574 C sub2/large6
575 575 C sub2/large7
576 576 $ hg remove normal
577 577 $ hg addremove --traceback
578 578 $ hg ci -m "addremoved normal"
579 579 Invoking status precommit hook
580 580 R normal
581 581 Invoking status postcommit hook
582 582 C large
583 583 C normal3
584 584 C sub/large4
585 585 C sub/normal4
586 586 C sub2/large6
587 587 C sub2/large7
588 588 $ hg up -C '.^'
589 589 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
590 590 $ hg remove large
591 591 $ hg addremove --traceback
592 592 $ hg ci -m "removed large"
593 593 Invoking status precommit hook
594 594 R large
595 595 created new head
596 596 Invoking status postcommit hook
597 597 C normal
598 598 C normal3
599 599 C sub/large4
600 600 C sub/normal4
601 601 C sub2/large6
602 602 C sub2/large7
603 603
604 604 Test commit -A (issue3542)
605 605 $ echo large8 > large8
606 606 $ hg add --large large8
607 607 $ hg ci -Am 'this used to add large8 as normal and commit both'
608 608 Invoking status precommit hook
609 609 A large8
610 610 Invoking status postcommit hook
611 611 C large8
612 612 C normal
613 613 C normal3
614 614 C sub/large4
615 615 C sub/normal4
616 616 C sub2/large6
617 617 C sub2/large7
618 618 $ rm large8
619 619 $ hg ci -Am 'this used to not notice the rm'
620 620 removing large8
621 621 Invoking status precommit hook
622 622 R large8
623 623 Invoking status postcommit hook
624 624 C normal
625 625 C normal3
626 626 C sub/large4
627 627 C sub/normal4
628 628 C sub2/large6
629 629 C sub2/large7
630 630
631 631 Test that a standin can't be added as a large file
632 632
633 633 $ touch large
634 634 $ hg add --large large
635 635 $ hg ci -m "add"
636 636 Invoking status precommit hook
637 637 A large
638 638 Invoking status postcommit hook
639 639 C large
640 640 C normal
641 641 C normal3
642 642 C sub/large4
643 643 C sub/normal4
644 644 C sub2/large6
645 645 C sub2/large7
646 646 $ hg remove large
647 647 $ touch large
648 648 $ hg addremove --config largefiles.patterns=**large --traceback
649 649 adding large as a largefile
650 650
651 651 Test that outgoing --large works (with revsets too)
652 652 $ hg outgoing --rev '.^' --large
653 653 comparing with $TESTTMP/a (glob)
654 654 searching for changes
655 655 changeset: 8:c02fd3b77ec4
656 656 user: test
657 657 date: Thu Jan 01 00:00:00 1970 +0000
658 658 summary: add foo
659 659
660 660 changeset: 9:289dd08c9bbb
661 661 user: test
662 662 date: Thu Jan 01 00:00:00 1970 +0000
663 663 summary: used to say nothing changed
664 664
665 665 changeset: 10:34f23ac6ac12
666 666 user: test
667 667 date: Thu Jan 01 00:00:00 1970 +0000
668 668 summary: added
669 669
670 670 changeset: 12:710c1b2f523c
671 671 parent: 10:34f23ac6ac12
672 672 user: test
673 673 date: Thu Jan 01 00:00:00 1970 +0000
674 674 summary: removed large
675 675
676 676 changeset: 13:0a3e75774479
677 677 user: test
678 678 date: Thu Jan 01 00:00:00 1970 +0000
679 679 summary: this used to add large8 as normal and commit both
680 680
681 681 changeset: 14:84f3d378175c
682 682 user: test
683 683 date: Thu Jan 01 00:00:00 1970 +0000
684 684 summary: this used to not notice the rm
685 685
686 686 largefiles to upload (1 entities):
687 687 large8
688 688
689 689 $ cd ../a
690 690
691 691 Clone a largefiles repo.
692 692
693 693 $ hg clone . ../b
694 694 updating to branch default
695 695 getting changed largefiles
696 696 3 largefiles updated, 0 removed
697 697 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
698 698 $ cd ../b
699 699 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
700 700 7:daea875e9014 add/edit more largefiles
701 701 6:4355d653f84f edit files yet again
702 702 5:9d5af5072dbd edit files again
703 703 4:74c02385b94c move files
704 704 3:9e8fbc4bce62 copy files
705 705 2:51a0ae4d5864 remove files
706 706 1:ce8896473775 edit files
707 707 0:30d30fe6a5be add files
708 708 $ cat normal3
709 709 normal33
710 710
711 711 Test graph log
712 712
713 713 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
714 714 @ 7:daea875e9014 add/edit more largefiles
715 715 |
716 716 o 6:4355d653f84f edit files yet again
717 717 |
718 718 o 5:9d5af5072dbd edit files again
719 719 |
720 720 o 4:74c02385b94c move files
721 721 |
722 722 o 3:9e8fbc4bce62 copy files
723 723 |
724 724 o 2:51a0ae4d5864 remove files
725 725 |
726 726 o 1:ce8896473775 edit files
727 727 |
728 728 o 0:30d30fe6a5be add files
729 729
730 730
731 731 Test log with --patch
732 732
733 733 $ hg log --patch -r 6::7
734 734 changeset: 6:4355d653f84f
735 735 user: test
736 736 date: Thu Jan 01 00:00:00 1970 +0000
737 737 summary: edit files yet again
738 738
739 739 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
740 740 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
741 741 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
742 742 @@ -1,1 +1,1 @@
743 743 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
744 744 +7838695e10da2bb75ac1156565f40a2595fa2fa0
745 745 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
746 746 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
747 747 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
748 748 @@ -1,1 +1,1 @@
749 749 -aeb2210d19f02886dde00dac279729a48471e2f9
750 750 +971fb41e78fea4f8e0ba5244784239371cb00591
751 751 diff -r 9d5af5072dbd -r 4355d653f84f normal3
752 752 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
753 753 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
754 754 @@ -1,1 +1,1 @@
755 755 -normal3
756 756 +normal33
757 757 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
758 758 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
759 759 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
760 760 @@ -1,1 +1,1 @@
761 761 -normal4
762 762 +normal44
763 763
764 764 changeset: 7:daea875e9014
765 765 tag: tip
766 766 user: test
767 767 date: Thu Jan 01 00:00:00 1970 +0000
768 768 summary: add/edit more largefiles
769 769
770 770 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
771 771 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
772 772 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
773 773 @@ -1,1 +0,0 @@
774 774 -7838695e10da2bb75ac1156565f40a2595fa2fa0
775 775 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
776 776 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
777 777 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
778 778 @@ -0,0 +1,1 @@
779 779 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
780 780 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
781 781 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
782 782 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
783 783 @@ -0,0 +1,1 @@
784 784 +bb3151689acb10f0c3125c560d5e63df914bc1af
785 785
786 786
787 787 $ hg log --patch -r 6::7 sub/
788 788 changeset: 6:4355d653f84f
789 789 user: test
790 790 date: Thu Jan 01 00:00:00 1970 +0000
791 791 summary: edit files yet again
792 792
793 793 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
794 794 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
795 795 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
796 796 @@ -1,1 +1,1 @@
797 797 -aeb2210d19f02886dde00dac279729a48471e2f9
798 798 +971fb41e78fea4f8e0ba5244784239371cb00591
799 799 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
800 800 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
801 801 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
802 802 @@ -1,1 +1,1 @@
803 803 -normal4
804 804 +normal44
805 805
806 806
807 807 log with both --follow and --patch
808 808
809 809 $ hg log --follow --patch --limit 2
810 810 changeset: 7:daea875e9014
811 811 tag: tip
812 812 user: test
813 813 date: Thu Jan 01 00:00:00 1970 +0000
814 814 summary: add/edit more largefiles
815 815
816 816 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
817 817 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
818 818 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
819 819 @@ -1,1 +0,0 @@
820 820 -7838695e10da2bb75ac1156565f40a2595fa2fa0
821 821 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
822 822 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
823 823 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
824 824 @@ -0,0 +1,1 @@
825 825 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
826 826 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
827 827 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
828 828 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
829 829 @@ -0,0 +1,1 @@
830 830 +bb3151689acb10f0c3125c560d5e63df914bc1af
831 831
832 832 changeset: 6:4355d653f84f
833 833 user: test
834 834 date: Thu Jan 01 00:00:00 1970 +0000
835 835 summary: edit files yet again
836 836
837 837 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
838 838 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
839 839 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
840 840 @@ -1,1 +1,1 @@
841 841 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
842 842 +7838695e10da2bb75ac1156565f40a2595fa2fa0
843 843 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
844 844 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
845 845 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
846 846 @@ -1,1 +1,1 @@
847 847 -aeb2210d19f02886dde00dac279729a48471e2f9
848 848 +971fb41e78fea4f8e0ba5244784239371cb00591
849 849 diff -r 9d5af5072dbd -r 4355d653f84f normal3
850 850 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
851 851 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
852 852 @@ -1,1 +1,1 @@
853 853 -normal3
854 854 +normal33
855 855 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
856 856 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
857 857 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
858 858 @@ -1,1 +1,1 @@
859 859 -normal4
860 860 +normal44
861 861
862 862 $ hg log --follow --patch sub/large4
863 863 changeset: 6:4355d653f84f
864 864 user: test
865 865 date: Thu Jan 01 00:00:00 1970 +0000
866 866 summary: edit files yet again
867 867
868 868 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
869 869 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
870 870 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
871 871 @@ -1,1 +1,1 @@
872 872 -aeb2210d19f02886dde00dac279729a48471e2f9
873 873 +971fb41e78fea4f8e0ba5244784239371cb00591
874 874
875 875 changeset: 5:9d5af5072dbd
876 876 user: test
877 877 date: Thu Jan 01 00:00:00 1970 +0000
878 878 summary: edit files again
879 879
880 880 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
881 881 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
882 882 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
883 883 @@ -1,1 +1,1 @@
884 884 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
885 885 +aeb2210d19f02886dde00dac279729a48471e2f9
886 886
887 887 changeset: 4:74c02385b94c
888 888 user: test
889 889 date: Thu Jan 01 00:00:00 1970 +0000
890 890 summary: move files
891 891
892 892 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
893 893 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
894 894 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
895 895 @@ -0,0 +1,1 @@
896 896 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
897 897
898 898 changeset: 1:ce8896473775
899 899 user: test
900 900 date: Thu Jan 01 00:00:00 1970 +0000
901 901 summary: edit files
902 902
903 903 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
904 904 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
905 905 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
906 906 @@ -1,1 +1,1 @@
907 907 -1deebade43c8c498a3c8daddac0244dc55d1331d
908 908 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
909 909
910 910 changeset: 0:30d30fe6a5be
911 911 user: test
912 912 date: Thu Jan 01 00:00:00 1970 +0000
913 913 summary: add files
914 914
915 915 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
916 916 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
917 917 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
918 918 @@ -0,0 +1,1 @@
919 919 +1deebade43c8c498a3c8daddac0244dc55d1331d
920 920
921 921 $ cat sub/normal4
922 922 normal44
923 923 $ cat sub/large4
924 924 large44
925 925 $ cat sub2/large6
926 926 large6
927 927 $ cat sub2/large7
928 928 large7
929 929 $ hg log -qf sub2/large7
930 930 7:daea875e9014
931 931 $ hg log -Gqf sub2/large7
932 932 @ 7:daea875e9014
933 933 |
934 934 ~
935 935 $ cd ..
936 936
937 937 Test log from outside repo
938 938
939 939 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
940 940 6:4355d653f84f edit files yet again
941 941 5:9d5af5072dbd edit files again
942 942 4:74c02385b94c move files
943 943 1:ce8896473775 edit files
944 944 0:30d30fe6a5be add files
945 945
946 946 Test clone at revision
947 947
948 948 $ hg clone a -r 3 c
949 949 adding changesets
950 950 adding manifests
951 951 adding file changes
952 952 added 4 changesets with 10 changes to 4 files
953 953 updating to branch default
954 954 getting changed largefiles
955 955 2 largefiles updated, 0 removed
956 956 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
957 957 $ cd c
958 958 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
959 959 3:9e8fbc4bce62 copy files
960 960 2:51a0ae4d5864 remove files
961 961 1:ce8896473775 edit files
962 962 0:30d30fe6a5be add files
963 963 $ cat normal1
964 964 normal22
965 965 $ cat large1
966 966 large22
967 967 $ cat sub/normal2
968 968 normal22
969 969 $ cat sub/large2
970 970 large22
971 971
972 972 Old revisions of a clone have correct largefiles content (this also
973 973 tests update).
974 974
975 975 $ hg update -r 1
976 976 getting changed largefiles
977 977 1 largefiles updated, 0 removed
978 978 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
979 979 $ cat large1
980 980 large11
981 981 $ cat sub/large2
982 982 large22
983 983 $ cd ..
984 984
985 985 Test cloning with --all-largefiles flag
986 986
987 987 $ rm "${USERCACHE}"/*
988 988 $ hg clone --all-largefiles a a-backup
989 989 updating to branch default
990 990 getting changed largefiles
991 991 3 largefiles updated, 0 removed
992 992 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
993 993 8 additional largefiles cached
994 994
995 995 $ rm "${USERCACHE}"/*
996 996 $ hg clone --all-largefiles -u 0 a a-clone0
997 997 updating to branch default
998 998 getting changed largefiles
999 999 2 largefiles updated, 0 removed
1000 1000 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1001 1001 9 additional largefiles cached
1002 1002 $ hg -R a-clone0 sum
1003 1003 parent: 0:30d30fe6a5be
1004 1004 add files
1005 1005 branch: default
1006 1006 commit: (clean)
1007 1007 update: 7 new changesets (update)
1008 1008 phases: 8 draft
1009 1009
1010 1010 $ rm "${USERCACHE}"/*
1011 1011 $ hg clone --all-largefiles -u 1 a a-clone1
1012 1012 updating to branch default
1013 1013 getting changed largefiles
1014 1014 2 largefiles updated, 0 removed
1015 1015 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1016 1016 8 additional largefiles cached
1017 1017 $ hg -R a-clone1 verify --large --lfa --lfc
1018 1018 checking changesets
1019 1019 checking manifests
1020 1020 crosschecking files in changesets and manifests
1021 1021 checking files
1022 1022 10 files, 8 changesets, 24 total revisions
1023 1023 searching 8 changesets for largefiles
1024 1024 verified contents of 13 revisions of 6 largefiles
1025 1025 $ hg -R a-clone1 sum
1026 1026 parent: 1:ce8896473775
1027 1027 edit files
1028 1028 branch: default
1029 1029 commit: (clean)
1030 1030 update: 6 new changesets (update)
1031 1031 phases: 8 draft
1032 1032
1033 1033 $ rm "${USERCACHE}"/*
1034 1034 $ hg clone --all-largefiles -U a a-clone-u
1035 1035 11 additional largefiles cached
1036 1036 $ hg -R a-clone-u sum
1037 1037 parent: -1:000000000000 (no revision checked out)
1038 1038 branch: default
1039 1039 commit: (clean)
1040 1040 update: 8 new changesets (update)
1041 1041 phases: 8 draft
1042 1042
1043 1043 Show computed destination directory:
1044 1044
1045 1045 $ mkdir xyz
1046 1046 $ cd xyz
1047 1047 $ hg clone ../a
1048 1048 destination directory: a
1049 1049 updating to branch default
1050 1050 getting changed largefiles
1051 1051 3 largefiles updated, 0 removed
1052 1052 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1053 1053 $ cd ..
1054 1054
1055 1055 Clone URL without path:
1056 1056
1057 1057 $ hg clone file://
1058 1058 abort: repository / not found!
1059 1059 [255]
1060 1060
1061 1061 Ensure base clone command argument validation
1062 1062
1063 1063 $ hg clone -U -u 0 a a-clone-failure
1064 1064 abort: cannot specify both --noupdate and --updaterev
1065 1065 [255]
1066 1066
1067 1067 $ hg clone --all-largefiles a ssh://localhost/a
1068 1068 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1069 1069 [255]
1070 1070
1071 1071 Test pulling with --all-largefiles flag. Also test that the largefiles are
1072 1072 downloaded from 'default' instead of 'default-push' when no source is specified
1073 1073 (issue3584)
1074 1074
1075 1075 $ rm -Rf a-backup
1076 1076 $ hg clone -r 1 a a-backup
1077 1077 adding changesets
1078 1078 adding manifests
1079 1079 adding file changes
1080 1080 added 2 changesets with 8 changes to 4 files
1081 1081 updating to branch default
1082 1082 getting changed largefiles
1083 1083 2 largefiles updated, 0 removed
1084 1084 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1085 1085 $ rm "${USERCACHE}"/*
1086 1086 $ cd a-backup
1087 1087 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1088 1088 pulling from $TESTTMP/a (glob)
1089 1089 searching for changes
1090 1090 adding changesets
1091 1091 adding manifests
1092 1092 adding file changes
1093 1093 added 6 changesets with 16 changes to 8 files
1094 1094 (run 'hg update' to get a working copy)
1095 1095 6 largefiles cached
1096 1096
1097 1097 redo pull with --lfrev and check it pulls largefiles for the right revs
1098 1098
1099 1099 $ hg rollback
1100 1100 repository tip rolled back to revision 1 (undo pull)
1101 1101 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1102 1102 pulling from $TESTTMP/a (glob)
1103 1103 searching for changes
1104 1104 all local heads known remotely
1105 1105 6 changesets found
1106 1106 uncompressed size of bundle content:
1107 1107 1333 (changelog)
1108 1108 1599 (manifests)
1109 1109 254 .hglf/large1
1110 1110 564 .hglf/large3
1111 1111 572 .hglf/sub/large4
1112 1112 182 .hglf/sub2/large6
1113 1113 182 .hglf/sub2/large7
1114 1114 212 normal1
1115 1115 457 normal3
1116 1116 465 sub/normal4
1117 1117 adding changesets
1118 1118 adding manifests
1119 1119 adding file changes
1120 1120 added 6 changesets with 16 changes to 8 files
1121 1121 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1122 1122 (run 'hg update' to get a working copy)
1123 1123 pulling largefiles for revision 7
1124 1124 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1125 1125 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1126 1126 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1127 1127 pulling largefiles for revision 2
1128 1128 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1129 1129 0 largefiles cached
1130 1130
1131 1131 lfpull
1132 1132
1133 1133 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1134 1134 2 largefiles cached
1135 1135 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1136 1136 pulling largefiles for revision 4
1137 1137 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1138 1138 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1139 1139 pulling largefiles for revision 2
1140 1140 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1141 1141 0 largefiles cached
1142 1142
1143 1143 $ ls usercache-lfpull/* | sort
1144 1144 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1145 1145 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1146 1146
1147 1147 $ cd ..
1148 1148
1149 1149 Rebasing between two repositories does not revert largefiles to old
1150 1150 revisions (this was a very bad bug that took a lot of work to fix).
1151 1151
1152 1152 $ hg clone a d
1153 1153 updating to branch default
1154 1154 getting changed largefiles
1155 1155 3 largefiles updated, 0 removed
1156 1156 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1157 1157 $ cd b
1158 1158 $ echo large4-modified > sub/large4
1159 1159 $ echo normal3-modified > normal3
1160 1160 $ hg commit -m "modify normal file and largefile in repo b"
1161 1161 Invoking status precommit hook
1162 1162 M normal3
1163 1163 M sub/large4
1164 1164 $ cd ../d
1165 1165 $ echo large6-modified > sub2/large6
1166 1166 $ echo normal4-modified > sub/normal4
1167 1167 $ hg commit -m "modify normal file largefile in repo d"
1168 1168 Invoking status precommit hook
1169 1169 M sub/normal4
1170 1170 M sub2/large6
1171 1171 $ cd ..
1172 1172 $ hg clone d e
1173 1173 updating to branch default
1174 1174 getting changed largefiles
1175 1175 3 largefiles updated, 0 removed
1176 1176 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1177 1177 $ cd d
1178 1178
1179 1179 More rebase testing, but also test that the largefiles are downloaded from
1180 1180 'default-push' when no source is specified (issue3584). (The largefile from the
1181 1181 pulled revision is however not downloaded but found in the local cache.)
1182 1182 Largefiles are fetched for the new pulled revision, not for existing revisions,
1183 1183 rebased or not.
1184 1184
1185 1185 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1186 1186 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1187 1187 pulling from $TESTTMP/b (glob)
1188 1188 searching for changes
1189 1189 adding changesets
1190 1190 adding manifests
1191 1191 adding file changes
1192 1192 added 1 changesets with 2 changes to 2 files (+1 heads)
1193 1193 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1194 1194 Invoking status precommit hook
1195 1195 M sub/normal4
1196 1196 M sub2/large6
1197 1197 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1198 1198 0 largefiles cached
1199 1199 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1200 1200 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1201 1201 9:598410d3eb9a modify normal file largefile in repo d
1202 1202 8:a381d2c8c80e modify normal file and largefile in repo b
1203 1203 7:daea875e9014 add/edit more largefiles
1204 1204 6:4355d653f84f edit files yet again
1205 1205 5:9d5af5072dbd edit files again
1206 1206 4:74c02385b94c move files
1207 1207 3:9e8fbc4bce62 copy files
1208 1208 2:51a0ae4d5864 remove files
1209 1209 1:ce8896473775 edit files
1210 1210 0:30d30fe6a5be add files
1211 1211 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1212 1212 @ 9:598410d3eb9a modify normal file largefile in repo d
1213 1213 |
1214 1214 o 8:a381d2c8c80e modify normal file and largefile in repo b
1215 1215 |
1216 1216 o 7:daea875e9014 add/edit more largefiles
1217 1217 |
1218 1218 o 6:4355d653f84f edit files yet again
1219 1219 |
1220 1220 o 5:9d5af5072dbd edit files again
1221 1221 |
1222 1222 o 4:74c02385b94c move files
1223 1223 |
1224 1224 o 3:9e8fbc4bce62 copy files
1225 1225 |
1226 1226 o 2:51a0ae4d5864 remove files
1227 1227 |
1228 1228 o 1:ce8896473775 edit files
1229 1229 |
1230 1230 o 0:30d30fe6a5be add files
1231 1231
1232 1232 $ cat normal3
1233 1233 normal3-modified
1234 1234 $ cat sub/normal4
1235 1235 normal4-modified
1236 1236 $ cat sub/large4
1237 1237 large4-modified
1238 1238 $ cat sub2/large6
1239 1239 large6-modified
1240 1240 $ cat sub2/large7
1241 1241 large7
1242 1242 $ cd ../e
1243 1243 $ hg pull ../b
1244 1244 pulling from ../b
1245 1245 searching for changes
1246 1246 adding changesets
1247 1247 adding manifests
1248 1248 adding file changes
1249 1249 added 1 changesets with 2 changes to 2 files (+1 heads)
1250 1250 (run 'hg heads' to see heads, 'hg merge' to merge)
1251 1251 $ hg rebase
1252 1252 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1253 1253 Invoking status precommit hook
1254 1254 M sub/normal4
1255 1255 M sub2/large6
1256 1256 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1257 1257 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1258 1258 9:598410d3eb9a modify normal file largefile in repo d
1259 1259 8:a381d2c8c80e modify normal file and largefile in repo b
1260 1260 7:daea875e9014 add/edit more largefiles
1261 1261 6:4355d653f84f edit files yet again
1262 1262 5:9d5af5072dbd edit files again
1263 1263 4:74c02385b94c move files
1264 1264 3:9e8fbc4bce62 copy files
1265 1265 2:51a0ae4d5864 remove files
1266 1266 1:ce8896473775 edit files
1267 1267 0:30d30fe6a5be add files
1268 1268 $ cat normal3
1269 1269 normal3-modified
1270 1270 $ cat sub/normal4
1271 1271 normal4-modified
1272 1272 $ cat sub/large4
1273 1273 large4-modified
1274 1274 $ cat sub2/large6
1275 1275 large6-modified
1276 1276 $ cat sub2/large7
1277 1277 large7
1278 1278
1279 1279 Log on largefiles
1280 1280
1281 1281 - same output
1282 1282 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1283 1283 8:a381d2c8c80e modify normal file and largefile in repo b
1284 1284 6:4355d653f84f edit files yet again
1285 1285 5:9d5af5072dbd edit files again
1286 1286 4:74c02385b94c move files
1287 1287 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1288 1288 o 8:a381d2c8c80e modify normal file and largefile in repo b
1289 1289 :
1290 1290 o 6:4355d653f84f edit files yet again
1291 1291 |
1292 1292 o 5:9d5af5072dbd edit files again
1293 1293 |
1294 1294 o 4:74c02385b94c move files
1295 1295 |
1296 1296 ~
1297 1297 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1298 1298 8:a381d2c8c80e modify normal file and largefile in repo b
1299 1299 6:4355d653f84f edit files yet again
1300 1300 5:9d5af5072dbd edit files again
1301 1301 4:74c02385b94c move files
1302 1302 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1303 1303 o 8:a381d2c8c80e modify normal file and largefile in repo b
1304 1304 :
1305 1305 o 6:4355d653f84f edit files yet again
1306 1306 |
1307 1307 o 5:9d5af5072dbd edit files again
1308 1308 |
1309 1309 o 4:74c02385b94c move files
1310 1310 |
1311 1311 ~
1312 1312
1313 1313 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1314 1314 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1315 1315 8:a381d2c8c80e modify normal file and largefile in repo b
1316 1316 6:4355d653f84f edit files yet again
1317 1317 5:9d5af5072dbd edit files again
1318 1318 4:74c02385b94c move files
1319 1319 1:ce8896473775 edit files
1320 1320 0:30d30fe6a5be add files
1321 1321 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1322 1322 o 8:a381d2c8c80e modify normal file and largefile in repo b
1323 1323 :
1324 1324 o 6:4355d653f84f edit files yet again
1325 1325 |
1326 1326 o 5:9d5af5072dbd edit files again
1327 1327 |
1328 1328 o 4:74c02385b94c move files
1329 1329 :
1330 1330 o 1:ce8896473775 edit files
1331 1331 |
1332 1332 o 0:30d30fe6a5be add files
1333 1333
1334 1334 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1335 1335 9:598410d3eb9a modify normal file largefile in repo d
1336 1336 8:a381d2c8c80e modify normal file and largefile in repo b
1337 1337 6:4355d653f84f edit files yet again
1338 1338 5:9d5af5072dbd edit files again
1339 1339 4:74c02385b94c move files
1340 1340 1:ce8896473775 edit files
1341 1341 0:30d30fe6a5be add files
1342 1342 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1343 1343 @ 9:598410d3eb9a modify normal file largefile in repo d
1344 1344 |
1345 1345 o 8:a381d2c8c80e modify normal file and largefile in repo b
1346 1346 :
1347 1347 o 6:4355d653f84f edit files yet again
1348 1348 |
1349 1349 o 5:9d5af5072dbd edit files again
1350 1350 |
1351 1351 o 4:74c02385b94c move files
1352 1352 :
1353 1353 o 1:ce8896473775 edit files
1354 1354 |
1355 1355 o 0:30d30fe6a5be add files
1356 1356
1357 1357 - globbing gives same result
1358 1358 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1359 1359 9:598410d3eb9a modify normal file largefile in repo d
1360 1360 8:a381d2c8c80e modify normal file and largefile in repo b
1361 1361 6:4355d653f84f edit files yet again
1362 1362 5:9d5af5072dbd edit files again
1363 1363 4:74c02385b94c move files
1364 1364 1:ce8896473775 edit files
1365 1365 0:30d30fe6a5be add files
1366 1366 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1367 1367 @ 9:598410d3eb9a modify normal file largefile in repo d
1368 1368 |
1369 1369 o 8:a381d2c8c80e modify normal file and largefile in repo b
1370 1370 :
1371 1371 o 6:4355d653f84f edit files yet again
1372 1372 |
1373 1373 o 5:9d5af5072dbd edit files again
1374 1374 |
1375 1375 o 4:74c02385b94c move files
1376 1376 :
1377 1377 o 1:ce8896473775 edit files
1378 1378 |
1379 1379 o 0:30d30fe6a5be add files
1380 1380
1381 1381 Rollback on largefiles.
1382 1382
1383 1383 $ echo large4-modified-again > sub/large4
1384 1384 $ hg commit -m "Modify large4 again"
1385 1385 Invoking status precommit hook
1386 1386 M sub/large4
1387 1387 $ hg rollback
1388 1388 repository tip rolled back to revision 9 (undo commit)
1389 1389 working directory now based on revision 9
1390 1390 $ hg st
1391 1391 M sub/large4
1392 1392 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1393 1393 9:598410d3eb9a modify normal file largefile in repo d
1394 1394 8:a381d2c8c80e modify normal file and largefile in repo b
1395 1395 7:daea875e9014 add/edit more largefiles
1396 1396 6:4355d653f84f edit files yet again
1397 1397 5:9d5af5072dbd edit files again
1398 1398 4:74c02385b94c move files
1399 1399 3:9e8fbc4bce62 copy files
1400 1400 2:51a0ae4d5864 remove files
1401 1401 1:ce8896473775 edit files
1402 1402 0:30d30fe6a5be add files
1403 1403 $ cat sub/large4
1404 1404 large4-modified-again
1405 1405
1406 1406 "update --check" refuses to update with uncommitted changes.
1407 1407 $ hg update --check 8
1408 1408 abort: uncommitted changes
1409 1409 [255]
1410 1410
1411 1411 "update --clean" leaves correct largefiles in working copy, even when there is
1412 1412 .orig files from revert in .hglf.
1413 1413
1414 1414 $ echo mistake > sub2/large7
1415 1415 $ hg revert sub2/large7
1416 1416 $ cat sub2/large7
1417 1417 large7
1418 1418 $ cat sub2/large7.orig
1419 1419 mistake
1420 1420 $ test ! -f .hglf/sub2/large7.orig
1421 1421
1422 1422 $ hg -q update --clean -r null
1423 1423 $ hg update --clean
1424 1424 getting changed largefiles
1425 1425 3 largefiles updated, 0 removed
1426 1426 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1427 1427 $ cat normal3
1428 1428 normal3-modified
1429 1429 $ cat sub/normal4
1430 1430 normal4-modified
1431 1431 $ cat sub/large4
1432 1432 large4-modified
1433 1433 $ cat sub2/large6
1434 1434 large6-modified
1435 1435 $ cat sub2/large7
1436 1436 large7
1437 1437 $ cat sub2/large7.orig
1438 1438 mistake
1439 1439 $ test ! -f .hglf/sub2/large7.orig
1440 1440
1441 1441 verify that largefile .orig file no longer is overwritten on every update -C:
1442 1442 $ hg update --clean
1443 1443 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1444 1444 $ cat sub2/large7.orig
1445 1445 mistake
1446 1446 $ rm sub2/large7.orig
1447 1447
1448 1448 Now "update check" is happy.
1449 1449 $ hg update --check 8
1450 1450 getting changed largefiles
1451 1451 1 largefiles updated, 0 removed
1452 1452 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1453 1453 $ hg update --check
1454 1454 getting changed largefiles
1455 1455 1 largefiles updated, 0 removed
1456 1456 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1457 1457
1458 1458 Test removing empty largefiles directories on update
1459 1459 $ test -d sub2 && echo "sub2 exists"
1460 1460 sub2 exists
1461 1461 $ hg update -q null
1462 1462 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1463 1463 [1]
1464 1464 $ hg update -q
1465 1465
1466 1466 Test hg remove removes empty largefiles directories
1467 1467 $ test -d sub2 && echo "sub2 exists"
1468 1468 sub2 exists
1469 1469 $ hg remove sub2/*
1470 1470 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1471 1471 [1]
1472 1472 $ hg revert sub2/large6 sub2/large7
1473 1473
1474 1474 "revert" works on largefiles (and normal files too).
1475 1475 $ echo hack3 >> normal3
1476 1476 $ echo hack4 >> sub/normal4
1477 1477 $ echo hack4 >> sub/large4
1478 1478 $ rm sub2/large6
1479 1479 $ hg revert sub2/large6
1480 1480 $ hg rm sub2/large6
1481 1481 $ echo new >> sub2/large8
1482 1482 $ hg add --large sub2/large8
1483 1483 # XXX we don't really want to report that we're reverting the standin;
1484 1484 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1485 1485 $ hg revert sub
1486 1486 reverting .hglf/sub/large4 (glob)
1487 1487 reverting sub/normal4 (glob)
1488 1488 $ hg status
1489 1489 M normal3
1490 1490 A sub2/large8
1491 1491 R sub2/large6
1492 1492 ? sub/large4.orig
1493 1493 ? sub/normal4.orig
1494 1494 $ cat sub/normal4
1495 1495 normal4-modified
1496 1496 $ cat sub/large4
1497 1497 large4-modified
1498 1498 $ hg revert -a --no-backup
1499 1499 undeleting .hglf/sub2/large6 (glob)
1500 1500 forgetting .hglf/sub2/large8 (glob)
1501 1501 reverting normal3
1502 1502 $ hg status
1503 1503 ? sub/large4.orig
1504 1504 ? sub/normal4.orig
1505 1505 ? sub2/large8
1506 1506 $ cat normal3
1507 1507 normal3-modified
1508 1508 $ cat sub2/large6
1509 1509 large6-modified
1510 1510 $ rm sub/*.orig sub2/large8
1511 1511
1512 1512 revert some files to an older revision
1513 1513 $ hg revert --no-backup -r 8 sub2
1514 1514 reverting .hglf/sub2/large6 (glob)
1515 1515 $ cat sub2/large6
1516 1516 large6
1517 1517 $ hg revert --no-backup -C -r '.^' sub2
1518 1518 $ hg revert --no-backup sub2
1519 1519 reverting .hglf/sub2/large6 (glob)
1520 1520 $ hg status
1521 1521
1522 1522 "verify --large" actually verifies largefiles
1523 1523
1524 1524 - Where Do We Come From? What Are We? Where Are We Going?
1525 1525 $ pwd
1526 1526 $TESTTMP/e
1527 1527 $ hg paths
1528 1528 default = $TESTTMP/d (glob)
1529 1529
1530 1530 $ hg verify --large
1531 1531 checking changesets
1532 1532 checking manifests
1533 1533 crosschecking files in changesets and manifests
1534 1534 checking files
1535 1535 10 files, 10 changesets, 28 total revisions
1536 1536 searching 1 changesets for largefiles
1537 1537 verified existence of 3 revisions of 3 largefiles
1538 1538
1539 - introduce missing blob in local store repo and make sure that this is caught:
1539 - introduce missing blob in local store repo and remote store
1540 and make sure that this is caught:
1541
1540 1542 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1543 $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1541 1544 $ hg verify --large
1542 1545 checking changesets
1543 1546 checking manifests
1544 1547 crosschecking files in changesets and manifests
1545 1548 checking files
1546 1549 10 files, 10 changesets, 28 total revisions
1547 1550 searching 1 changesets for largefiles
1548 1551 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1549 1552 verified existence of 3 revisions of 3 largefiles
1550 1553 [1]
1551 1554
1552 1555 - introduce corruption and make sure that it is caught when checking content:
1553 1556 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1554 1557 $ hg verify -q --large --lfc
1555 1558 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1556 1559 [1]
1557 1560
1558 1561 - cleanup
1559 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1562 $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1563 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/
1560 1564
1561 1565 - verifying all revisions will fail because we didn't clone all largefiles to d:
1562 1566 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1563 1567 $ hg verify -q --lfa --lfc
1564 1568 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1565 1569 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1566 1570 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1567 1571 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1568 1572 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1569 1573 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1570 1574 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1571 1575 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1572 1576 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1573 1577 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1574 1578 [1]
1575 1579
1576 1580 - cleanup
1577 1581 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1578 1582 $ rm -f .hglf/sub/*.orig
1579 1583
1580 1584 Update to revision with missing largefile - and make sure it really is missing
1581 1585
1582 1586 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1583 1587 $ hg up -r 6
1584 1588 getting changed largefiles
1585 1589 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1586 1590 1 largefiles updated, 2 removed
1587 1591 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1588 1592 $ rm normal3
1589 1593 $ echo >> sub/normal4
1590 1594 $ hg ci -m 'commit with missing files'
1591 1595 Invoking status precommit hook
1592 1596 M sub/normal4
1593 1597 ! large3
1594 1598 ! normal3
1595 1599 created new head
1596 1600 $ hg st
1597 1601 ! large3
1598 1602 ! normal3
1599 1603 $ hg up -r.
1600 1604 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1601 1605 $ hg st
1602 1606 ! large3
1603 1607 ! normal3
1604 1608 $ hg up -Cr.
1605 1609 getting changed largefiles
1606 1610 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1607 1611 0 largefiles updated, 0 removed
1608 1612 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1609 1613 $ hg st
1610 1614 ! large3
1611 1615 $ hg rollback
1612 1616 repository tip rolled back to revision 9 (undo commit)
1613 1617 working directory now based on revision 6
1614 1618
1615 1619 Merge with revision with missing largefile - and make sure it tries to fetch it.
1616 1620
1617 1621 $ hg up -Cqr null
1618 1622 $ echo f > f
1619 1623 $ hg ci -Am branch
1620 1624 adding f
1621 1625 Invoking status precommit hook
1622 1626 A f
1623 1627 created new head
1624 1628 $ hg merge -r 6
1625 1629 getting changed largefiles
1626 1630 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1627 1631 1 largefiles updated, 0 removed
1628 1632 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1629 1633 (branch merge, don't forget to commit)
1630 1634
1631 1635 $ hg rollback -q
1632 1636 $ hg up -Cq
1633 1637
1634 1638 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1635 1639
1636 1640 $ hg pull --all-largefiles
1637 1641 pulling from $TESTTMP/d (glob)
1638 1642 searching for changes
1639 1643 no changes found
1640 1644
1641 1645 Merging does not revert to old versions of largefiles and also check
1642 1646 that merging after having pulled from a non-default remote works
1643 1647 correctly.
1644 1648
1645 1649 $ cd ..
1646 1650 $ hg clone -r 7 e temp
1647 1651 adding changesets
1648 1652 adding manifests
1649 1653 adding file changes
1650 1654 added 8 changesets with 24 changes to 10 files
1651 1655 updating to branch default
1652 1656 getting changed largefiles
1653 1657 3 largefiles updated, 0 removed
1654 1658 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1655 1659 $ hg clone temp f
1656 1660 updating to branch default
1657 1661 getting changed largefiles
1658 1662 3 largefiles updated, 0 removed
1659 1663 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1660 1664 # Delete the largefiles in the largefiles system cache so that we have an
1661 1665 # opportunity to test that caching after a pull works.
1662 1666 $ rm "${USERCACHE}"/*
1663 1667 $ cd f
1664 1668 $ echo "large4-merge-test" > sub/large4
1665 1669 $ hg commit -m "Modify large4 to test merge"
1666 1670 Invoking status precommit hook
1667 1671 M sub/large4
1668 1672 # Test --cache-largefiles flag
1669 1673 $ hg pull --lfrev 'heads(pulled())' ../e
1670 1674 pulling from ../e
1671 1675 searching for changes
1672 1676 adding changesets
1673 1677 adding manifests
1674 1678 adding file changes
1675 1679 added 2 changesets with 4 changes to 4 files (+1 heads)
1676 1680 (run 'hg heads' to see heads, 'hg merge' to merge)
1677 1681 2 largefiles cached
1678 1682 $ hg merge
1679 1683 largefile sub/large4 has a merge conflict
1680 1684 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1681 1685 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1682 1686 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1683 1687 getting changed largefiles
1684 1688 1 largefiles updated, 0 removed
1685 1689 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1686 1690 (branch merge, don't forget to commit)
1687 1691 $ hg commit -m "Merge repos e and f"
1688 1692 Invoking status precommit hook
1689 1693 M normal3
1690 1694 M sub/normal4
1691 1695 M sub2/large6
1692 1696 $ cat normal3
1693 1697 normal3-modified
1694 1698 $ cat sub/normal4
1695 1699 normal4-modified
1696 1700 $ cat sub/large4
1697 1701 large4-merge-test
1698 1702 $ cat sub2/large6
1699 1703 large6-modified
1700 1704 $ cat sub2/large7
1701 1705 large7
1702 1706
1703 1707 Test status after merging with a branch that introduces a new largefile:
1704 1708
1705 1709 $ echo large > large
1706 1710 $ hg add --large large
1707 1711 $ hg commit -m 'add largefile'
1708 1712 Invoking status precommit hook
1709 1713 A large
1710 1714 $ hg update -q ".^"
1711 1715 $ echo change >> normal3
1712 1716 $ hg commit -m 'some change'
1713 1717 Invoking status precommit hook
1714 1718 M normal3
1715 1719 created new head
1716 1720 $ hg merge
1717 1721 getting changed largefiles
1718 1722 1 largefiles updated, 0 removed
1719 1723 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1720 1724 (branch merge, don't forget to commit)
1721 1725 $ hg status
1722 1726 M large
1723 1727
1724 1728 - make sure update of merge with removed largefiles fails as expected
1725 1729 $ hg rm sub2/large6
1726 1730 $ hg up -r.
1727 1731 abort: outstanding uncommitted merge
1728 1732 [255]
1729 1733
1730 1734 - revert should be able to revert files introduced in a pending merge
1731 1735 $ hg revert --all -r .
1732 1736 removing .hglf/large (glob)
1733 1737 undeleting .hglf/sub2/large6 (glob)
1734 1738
1735 1739 Test that a normal file and a largefile with the same name and path cannot
1736 1740 coexist.
1737 1741
1738 1742 $ rm sub2/large7
1739 1743 $ echo "largeasnormal" > sub2/large7
1740 1744 $ hg add sub2/large7
1741 1745 sub2/large7 already a largefile (glob)
1742 1746
1743 1747 Test that transplanting a largefile change works correctly.
1744 1748
1745 1749 $ cd ..
1746 1750 $ hg clone -r 8 d g
1747 1751 adding changesets
1748 1752 adding manifests
1749 1753 adding file changes
1750 1754 added 9 changesets with 26 changes to 10 files
1751 1755 updating to branch default
1752 1756 getting changed largefiles
1753 1757 3 largefiles updated, 0 removed
1754 1758 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1755 1759 $ cd g
1756 1760 $ hg transplant -s ../d 598410d3eb9a
1757 1761 searching for changes
1758 1762 searching for changes
1759 1763 adding changesets
1760 1764 adding manifests
1761 1765 adding file changes
1762 1766 added 1 changesets with 2 changes to 2 files
1763 1767 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1764 1768 9:598410d3eb9a modify normal file largefile in repo d
1765 1769 8:a381d2c8c80e modify normal file and largefile in repo b
1766 1770 7:daea875e9014 add/edit more largefiles
1767 1771 6:4355d653f84f edit files yet again
1768 1772 5:9d5af5072dbd edit files again
1769 1773 4:74c02385b94c move files
1770 1774 3:9e8fbc4bce62 copy files
1771 1775 2:51a0ae4d5864 remove files
1772 1776 1:ce8896473775 edit files
1773 1777 0:30d30fe6a5be add files
1774 1778 $ cat normal3
1775 1779 normal3-modified
1776 1780 $ cat sub/normal4
1777 1781 normal4-modified
1778 1782 $ cat sub/large4
1779 1783 large4-modified
1780 1784 $ cat sub2/large6
1781 1785 large6-modified
1782 1786 $ cat sub2/large7
1783 1787 large7
1784 1788
1785 1789 Cat a largefile
1786 1790 $ hg cat normal3
1787 1791 normal3-modified
1788 1792 $ hg cat sub/large4
1789 1793 large4-modified
1790 1794 $ rm "${USERCACHE}"/*
1791 1795 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1792 1796 $ cat cat.out
1793 1797 large4-modified
1794 1798 $ rm cat.out
1795 1799 $ hg cat -r a381d2c8c80e normal3
1796 1800 normal3-modified
1797 1801 $ hg cat -r '.^' normal3
1798 1802 normal3-modified
1799 1803 $ hg cat -r '.^' sub/large4 doesntexist
1800 1804 large4-modified
1801 1805 doesntexist: no such file in rev a381d2c8c80e
1802 1806 $ hg --cwd sub cat -r '.^' large4
1803 1807 large4-modified
1804 1808 $ hg --cwd sub cat -r '.^' ../normal3
1805 1809 normal3-modified
1806 1810 Cat a standin
1807 1811 $ hg cat .hglf/sub/large4
1808 1812 e166e74c7303192238d60af5a9c4ce9bef0b7928
1809 1813 $ hg cat .hglf/normal3
1810 1814 .hglf/normal3: no such file in rev 598410d3eb9a (glob)
1811 1815 [1]
1812 1816
1813 1817 Test that renaming a largefile results in correct output for status
1814 1818
1815 1819 $ hg rename sub/large4 large4-renamed
1816 1820 $ hg commit -m "test rename output"
1817 1821 Invoking status precommit hook
1818 1822 A large4-renamed
1819 1823 R sub/large4
1820 1824 $ cat large4-renamed
1821 1825 large4-modified
1822 1826 $ cd sub2
1823 1827 $ hg rename large6 large6-renamed
1824 1828 $ hg st
1825 1829 A sub2/large6-renamed
1826 1830 R sub2/large6
1827 1831 $ cd ..
1828 1832
1829 1833 Test --normal flag
1830 1834
1831 1835 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1832 1836 $ hg add --normal --large new-largefile
1833 1837 abort: --normal cannot be used with --large
1834 1838 [255]
1835 1839 $ hg add --normal new-largefile
1836 1840 new-largefile: up to 69 MB of RAM may be required to manage this file
1837 1841 (use 'hg revert new-largefile' to cancel the pending addition)
1838 1842
1839 1843 Test explicit commit of switch between normal and largefile - make sure both
1840 1844 the add and the remove is committed.
1841 1845
1842 1846 $ hg up -qC
1843 1847 $ hg forget normal3 large4-renamed
1844 1848 $ hg add --large normal3
1845 1849 $ hg add large4-renamed
1846 1850 $ hg commit -m 'swap' normal3 large4-renamed
1847 1851 Invoking status precommit hook
1848 1852 A large4-renamed
1849 1853 A normal3
1850 1854 ? new-largefile
1851 1855 ? sub2/large6-renamed
1852 1856 $ hg mani
1853 1857 .hglf/normal3
1854 1858 .hglf/sub2/large6
1855 1859 .hglf/sub2/large7
1856 1860 large4-renamed
1857 1861 sub/normal4
1858 1862
1859 1863 $ cd ..
1860 1864
1861 1865
1862 1866
General Comments 0
You need to be logged in to leave comments. Login now