##// END OF EJS Templates
largefiles: always create the cache and standin directories when cloning...
Matt Harbison -
r17824:221c9c31 default
parent child Browse files
Show More
@@ -733,24 +733,29 b' def overrideclone(orig, ui, source, dest'
733 def hgclone(orig, ui, opts, *args, **kwargs):
733 def hgclone(orig, ui, opts, *args, **kwargs):
734 result = orig(ui, opts, *args, **kwargs)
734 result = orig(ui, opts, *args, **kwargs)
735
735
736 if result is not None and opts.get('all_largefiles'):
736 if result is not None:
737 sourcerepo, destrepo = result
737 sourcerepo, destrepo = result
738 repo = destrepo.local()
738 repo = destrepo.local()
739
739
740 # The .hglf directory must exist for the standin matcher to match
740 # The .hglf directory must exist for the standin matcher to match
741 # anything (which listlfiles uses for each rev), and .hg/largefiles is
741 # anything (which listlfiles uses for each rev), and .hg/largefiles is
742 # assumed to exist by the code that caches the downloaded file. These
742 # assumed to exist by the code that caches the downloaded file. These
743 # directories exist if clone updated to any rev.
743 # directories exist if clone updated to any rev. (If the repo does not
744 if opts.get('noupdate'):
744 # have largefiles, download never gets to the point of needing
745 util.makedirs(repo.pathto(lfutil.shortname))
745 # .hg/largefiles, and the standin matcher won't match anything anyway.)
746 util.makedirs(repo.join(lfutil.longname))
746 if 'largefiles' in repo.requirements:
747 if opts.get('noupdate'):
748 util.makedirs(repo.pathto(lfutil.shortname))
749 util.makedirs(repo.join(lfutil.longname))
747
750
748 # Caching is implicitly limited to 'rev' option, since the dest repo was
751 # Caching is implicitly limited to 'rev' option, since the dest repo was
749 # truncated at that point.
752 # truncated at that point. The user may expect a download count with
750 success, missing = lfcommands.downloadlfiles(ui, repo, None)
753 # this option, so attempt whether or not this is a largefile repo.
754 if opts.get('all_largefiles'):
755 success, missing = lfcommands.downloadlfiles(ui, repo, None)
751
756
752 if missing != 0:
757 if missing != 0:
753 return None
758 return None
754
759
755 return result
760 return result
756
761
@@ -276,10 +276,21 b' round-trip: converting back to a normal '
276
276
277 Avoid a traceback if a largefile isn't available (issue3519)
277 Avoid a traceback if a largefile isn't available (issue3519)
278
278
279 Ensure the largefile can be cached in the source if necessary
279 $ hg clone -U largefiles-repo issue3519
280 $ hg clone -U largefiles-repo issue3519
280 $ rm "${USERCACHE}"/*
281 $ rm "${USERCACHE}"/*
281 $ hg lfconvert --to-normal issue3519 normalized3519
282 $ hg lfconvert --to-normal issue3519 normalized3519
282 initializing destination normalized3519
283 initializing destination normalized3519
284
285 Ensure the abort message is useful if a largefile is entirely unavailable
286 $ rm -rf normalized3519
287 $ rm "${USERCACHE}"/*
288 $ rm issue3519/.hg/largefiles/*
289 $ rm largefiles-repo/.hg/largefiles/*
290 $ hg lfconvert --to-normal issue3519 normalized3519
291 initializing destination normalized3519
292 large: can't get file locally
293 (no default or default-push path set in hgrc)
283 abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
294 abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
284 [255]
295 [255]
285
296
General Comments 0
You need to be logged in to leave comments. Login now