# HG changeset patch # User Matt Harbison # Date 1347176258 14400 # Node ID 56136786000fca929b565680730228255b2590af # Parent b7302d65006cb139b1e09eec38c37b0ddf4e676b largefiles: restore caching of largefiles with 'clone -U --all-largefiles' This was broken when restoring normal -u and -U functionality. diff -r b7302d65006c -r 56136786000f hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Sat Sep 08 13:31:06 2012 -0400 +++ b/hgext/largefiles/overrides.py Sun Sep 09 03:37:38 2012 -0400 @@ -736,7 +736,19 @@ return True if opts.get('all_largefiles'): sourcerepo, destrepo = result - success, missing = lfcommands.downloadlfiles(ui, destrepo.local(), None) + repo = destrepo.local() + + # The .hglf directory must exist for the standin matcher to match + # anything (which listlfiles uses for each rev), and .hg/largefiles is + # assumed to exist by the code that caches the downloaded file. These + # directories exist if clone updated to any rev. + if opts.get('noupdate'): + util.makedirs(repo.pathto(lfutil.shortname)) + util.makedirs(repo.join(lfutil.longname)) + + # Caching is implicitly limited to 'rev' option, since the dest repo was + # truncated at that point. + success, missing = lfcommands.downloadlfiles(ui, repo, None) return missing != 0 return result is None diff -r b7302d65006c -r 56136786000f tests/test-largefiles.t --- a/tests/test-largefiles.t Sat Sep 08 13:31:06 2012 -0400 +++ b/tests/test-largefiles.t Sun Sep 09 03:37:38 2012 -0400 @@ -700,7 +700,7 @@ $ rm "${USERCACHE}"/* $ hg clone --all-largefiles -U a a-clone-u - 0 additional largefiles cached + 11 additional largefiles cached $ hg -R a-clone-u sum parent: -1:000000000000 (no revision checked out) branch: default