diff hgext/largefiles/overrides.py @ 17599:56136786000f stable

largefiles: restore caching of largefiles with 'clone -U --all-largefiles' This was broken when restoring normal -u and -U functionality.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 09 Sep 2012 03:37:38 -0400
parents b7302d65006c
children 3a1c6b64e052
line wrap: on
line diff
--- 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