diff hgext/largefiles/lfutil.py @ 27903:512a814c5595

largefiles: fix commit of missing largefiles 832c98d79587 improved merging of standin files referencing missing largefiles. It did however not test or fix commits of such merges; it would abort. To fix that, change copytostore to skip and warn about missing largefiles with a message similar the one for failing get from remote filestores. (It would perhaps in both cases be better to emit a more helpful warning like "warning: standin file for large1 references 58e24f733a which can't be found in the local store".) To test this, make sure commit doesn't find the "missing" largefile in the global usercache. For further testing, verify that update and status works as expected after this. This will also effectively backout 63116d47cc3f.
author Mads Kiilerich <madski@unity3d.com>
date Sun, 17 Jan 2016 17:23:32 +0100
parents 45e8bd2f36f0
children eb1135d5e688
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Thu Jan 14 10:22:55 2016 -0800
+++ b/hgext/largefiles/lfutil.py	Sun Jan 17 17:23:32 2016 +0100
@@ -221,7 +221,12 @@
     hash = readstandin(repo, file, rev)
     if instore(repo, hash):
         return
-    copytostoreabsolute(repo, repo.wjoin(file), hash)
+    absfile = repo.wjoin(file)
+    if os.path.exists(absfile):
+        copytostoreabsolute(repo, absfile, hash)
+    else:
+        repo.ui.warn(_("%s: largefile %s not available from local store\n") %
+                     (file, hash))
 
 def copyalltostore(repo, node):
     '''Copy all largefiles in a given revision to the store'''