changeset 35541:58fda95a0202

lfs: add a comment to describe subtle local blobstore open() behavior
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 05 Jan 2018 21:48:29 -0500
parents f04d16bef2c7
children beb667c9880f
files hgext/lfs/blobstore.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/lfs/blobstore.py	Fri Jan 05 11:53:33 2018 -0800
+++ b/hgext/lfs/blobstore.py	Fri Jan 05 21:48:29 2018 -0500
@@ -103,6 +103,12 @@
     def open(self, oid):
         """Open a read-only file descriptor to the named blob, in either the
         usercache or the local store."""
+        # The usercache is the most likely place to hold the file.  Commit will
+        # write to both it and the local store, as will anything that downloads
+        # the blobs.  However, things like clone without an update won't
+        # populate the local store.  For an init + push of a local clone,
+        # the usercache is the only place it _could_ be.  If not present, the
+        # missing file msg here will indicate the local repo, not the usercache.
         if self.cachevfs.exists(oid):
             return self.cachevfs(oid, 'rb')