changeset 29329:f359cdc91e21 stable

largefiles: fix support for local largefiles while using share extension Prior to revision 2a3f24786d09, largefiles were saved in the local repository, even if it was using the share extension. After that change, all largefiles are now stored in the shared repository. However, the backward compatibility for existing largefiles already placed in the local repository was never tested, and has been broken since.
author Henrik Stuart <henriks@unity3d.com>
date Tue, 07 Jun 2016 08:32:33 +0200
parents d29cb5e735e9
children 8bf84295e59b dd9175ca81dc
files hgext/largefiles/lfutil.py tests/test-largefiles-cache.t
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Thu Jun 02 17:11:32 2016 -0500
+++ b/hgext/largefiles/lfutil.py	Tue Jun 07 08:32:33 2016 +0200
@@ -204,7 +204,7 @@
     if instore(repo, hash):
         return (path, True)
     elif repo.shared() and instore(repo, hash, True):
-        return storepath(repo, hash, True)
+        return storepath(repo, hash, True), True
 
     return (path, False)
 
--- a/tests/test-largefiles-cache.t	Thu Jun 02 17:11:32 2016 -0500
+++ b/tests/test-largefiles-cache.t	Tue Jun 07 08:32:33 2016 +0200
@@ -186,6 +186,10 @@
   src/.hg/largefiles/dirstate
   src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
 
+Verify that backwards compatibility is maintained for old storage layout
+  $ mv src/.hg/largefiles/$hash share_dst/.hg/largefiles
+  $ hg verify --quiet --lfa -R share_dst --config largefiles.usercache=
+
 Inject corruption into the largefiles store and see how update handles that:
 
   $ cd src