largefiles: restore caching of largefiles with 'clone -U --all-largefiles' stable
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 09 Sep 2012 03:37:38 -0400
branchstable
changeset 17599 56136786000f
parent 17598 b7302d65006c
child 17600 3a1c6b64e052
largefiles: restore caching of largefiles with 'clone -U --all-largefiles' This was broken when restoring normal -u and -U functionality.
hgext/largefiles/overrides.py
tests/test-largefiles.t
--- 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
 
--- 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