##// END OF EJS Templates
largefiles: don't copy largefiles from working dir to the store while converting...
Matt Harbison -
r17878:d1d01402 stable
parent child Browse files
Show More
@@ -234,7 +234,7 b' def copytostoreabsolute(repo, file, hash'
234 util.makedirs(os.path.dirname(storepath(repo, hash)))
234 util.makedirs(os.path.dirname(storepath(repo, hash)))
235 if inusercache(repo.ui, hash):
235 if inusercache(repo.ui, hash):
236 link(usercachepath(repo.ui, hash), storepath(repo, hash))
236 link(usercachepath(repo.ui, hash), storepath(repo, hash))
237 else:
237 elif not getattr(repo, "_isconverting", False):
238 dst = util.atomictempfile(storepath(repo, hash),
238 dst = util.atomictempfile(storepath(repo, hash),
239 createmode=repo.store.createmode)
239 createmode=repo.store.createmode)
240 for chunk in util.filechunkiter(open(file, 'rb')):
240 for chunk in util.filechunkiter(open(file, 'rb')):
@@ -1113,3 +1113,11 b' def overridecat(orig, ui, repo, file1, *'
1113 result = orig(ui, repo, file1, *pats, **opts)
1113 result = orig(ui, repo, file1, *pats, **opts)
1114 return result
1114 return result
1115 return lfcommands.catlfile(repo, file1, ctx.rev(), opts.get('output'))
1115 return lfcommands.catlfile(repo, file1, ctx.rev(), opts.get('output'))
1116
1117 def mercurialsinkbefore(orig, sink):
1118 sink.repo._isconverting = True
1119 orig(sink)
1120
1121 def mercurialsinkafter(orig, sink):
1122 sink.repo._isconverting = False
1123 orig(sink)
@@ -168,3 +168,10 b' def uisetup(ui):'
168 if name == 'transplant':
168 if name == 'transplant':
169 extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant',
169 extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant',
170 overrides.overridetransplant)
170 overrides.overridetransplant)
171 if name == 'convert':
172 convcmd = getattr(module, 'convcmd')
173 hgsink = getattr(convcmd, 'mercurial_sink')
174 extensions.wrapfunction(hgsink, 'before',
175 overrides.mercurialsinkbefore)
176 extensions.wrapfunction(hgsink, 'after',
177 overrides.mercurialsinkafter)
@@ -275,6 +275,9 b' round-trip: converting back to a normal '
275
275
276 $ cd ..
276 $ cd ..
277
277
278 Clearing the usercache ensures that commitctx doesn't try to cache largefiles
279 from the working dir on a convert.
280 $ rm "${USERCACHE}"/*
278 $ hg convert largefiles-repo
281 $ hg convert largefiles-repo
279 assuming destination largefiles-repo-hg
282 assuming destination largefiles-repo-hg
280 initializing destination largefiles-repo-hg repository
283 initializing destination largefiles-repo-hg repository
@@ -304,6 +307,9 b' round-trip: converting back to a normal '
304 |
307 |
305 o 0:d4892ec57ce2 add large, normal1
308 o 0:d4892ec57ce2 add large, normal1
306
309
310 Verify will fail (for now) if the usercache is purged before converting, since
311 largefiles are not cached in the converted repo's local store by the conversion
312 process.
307 $ hg -R largefiles-repo-hg verify --large --lfa
313 $ hg -R largefiles-repo-hg verify --large --lfa
308 checking changesets
314 checking changesets
309 checking manifests
315 checking manifests
@@ -311,7 +317,20 b' round-trip: converting back to a normal '
311 checking files
317 checking files
312 8 files, 7 changesets, 12 total revisions
318 8 files, 7 changesets, 12 total revisions
313 searching 7 changesets for largefiles
319 searching 7 changesets for largefiles
320 changeset 0:d4892ec57ce2: large missing
321 (looked for hash 2e000fa7e85759c7f4c254d4d9c33ef481e459a7)
322 changeset 1:334e5237836d: sub/maybelarge.dat missing
323 (looked for hash 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c)
324 changeset 2:261ad3f3f037: stuff/maybelarge.dat missing
325 (looked for hash 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c)
326 changeset 3:55759520c76f: sub/maybelarge.dat missing
327 (looked for hash 76236b6a2c6102826c61af4297dd738fb3b1de38)
328 changeset 5:9cc5aa7204f0: stuff/maybelarge.dat missing
329 (looked for hash 76236b6a2c6102826c61af4297dd738fb3b1de38)
330 changeset 6:17126745edfd: anotherlarge missing
331 (looked for hash 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3)
314 verified existence of 6 revisions of 4 largefiles
332 verified existence of 6 revisions of 4 largefiles
333 [1]
315 $ hg -R largefiles-repo-hg showconfig paths
334 $ hg -R largefiles-repo-hg showconfig paths
316
335
317
336
@@ -319,7 +338,7 b" Avoid a traceback if a largefile isn't a"
319
338
320 Ensure the largefile can be cached in the source if necessary
339 Ensure the largefile can be cached in the source if necessary
321 $ hg clone -U largefiles-repo issue3519
340 $ hg clone -U largefiles-repo issue3519
322 $ rm "${USERCACHE}"/*
341 $ rm -f "${USERCACHE}"/*
323 $ hg lfconvert --to-normal issue3519 normalized3519
342 $ hg lfconvert --to-normal issue3519 normalized3519
324 initializing destination normalized3519
343 initializing destination normalized3519
325
344
General Comments 0
You need to be logged in to leave comments. Login now