hgext/largefiles/lfcommands.py
changeset 16700 28001e8a5149
parent 16691 7d6a660ca151
child 16727 3e24ce3de5f1
--- a/hgext/largefiles/lfcommands.py	Sun May 13 12:52:24 2012 +0200
+++ b/hgext/largefiles/lfcommands.py	Sat May 12 15:41:27 2012 +0200
@@ -365,7 +365,7 @@
     store = basestore._openstore(repo)
     return store.verify(revs, contents=contents)
 
-def cachelfiles(ui, repo, node):
+def cachelfiles(ui, repo, node, filelist=None):
     '''cachelfiles ensures that all largefiles needed by the specified revision
     are present in the repository's largefile cache.
 
@@ -373,6 +373,8 @@
     by this operation; missing is the list of files that were needed but could
     not be found.'''
     lfiles = lfutil.listlfiles(repo, node)
+    if filelist:
+        lfiles = set(lfiles) & set(filelist)
     toget = []
 
     for lfile in lfiles:
@@ -431,7 +433,7 @@
         if printmessage and lfiles:
             ui.status(_('getting changed largefiles\n'))
             printed = True
-            cachelfiles(ui, repo, '.')
+            cachelfiles(ui, repo, '.', lfiles)
 
         updated, removed = 0, 0
         for i in map(lambda f: _updatelfile(repo, lfdirstate, f), lfiles):