lfs: add a comment to describe subtle local blobstore open() behavior
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 05 Jan 2018 21:48:29 -0500
changeset 35537 58fda95a0202
parent 35536 f04d16bef2c7
child 35542 beb667c9880f
lfs: add a comment to describe subtle local blobstore open() behavior
hgext/lfs/blobstore.py
--- 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')