diff hgext/largefiles/basestore.py @ 19008:9d33d6e0d442

largefiles: stat all largefiles in one batch before downloading This avoids a lot of expensive roundtrips to remote repositories ... but might be slightly slower for local operations. This will also change some aborts on missing files to warnings. That will in some situations make it possible to continue working on a repository with missing largefiles.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 15 Apr 2013 23:37:43 +0200
parents 266b5fb72f26
children ae65192fd6b4
line wrap: on
line diff
--- a/hgext/largefiles/basestore.py	Mon Apr 15 23:34:36 2013 +0200
+++ b/hgext/largefiles/basestore.py	Mon Apr 15 23:37:43 2013 +0200
@@ -62,12 +62,19 @@
         util.makedirs(lfutil.storepath(self.repo, ''))
 
         at = 0
+        available = self.exists(set(hash for (_filename, hash) in files))
         for filename, hash in files:
             ui.progress(_('getting largefiles'), at, unit='lfile',
                 total=len(files))
             at += 1
             ui.note(_('getting %s:%s\n') % (filename, hash))
 
+            if not available.get(hash):
+                ui.warn(_('%s: largefile %s not available from %s\n')
+                        % (filename, hash, self.url))
+                missing.append(filename)
+                continue
+
             storefilename = lfutil.storepath(self.repo, hash)
             tmpfile = util.atomictempfile(storefilename + '.tmp',
                                           createmode=self.repo.store.createmode)