make clear when code is using deprecated direct mode files

This commit is contained in:
Joey Hess 2015-12-09 19:43:15 -04:00
parent aa88851ec1
commit 3719d1b390
Failed to extract signature
2 changed files with 17 additions and 14 deletions

View file

@ -63,7 +63,7 @@ import Config
import Git.SharedRepository import Git.SharedRepository
import Annex.Perms import Annex.Perms
import Annex.Link import Annex.Link
import Annex.Content.Direct import qualified Annex.Content.Direct as Direct
import Annex.ReplaceFile import Annex.ReplaceFile
import Annex.LockPool import Annex.LockPool
import Messages.Progress import Messages.Progress
@ -100,7 +100,7 @@ inAnnex' isgood bad check key = withObjectLoc key checkindirect checkdirect
checkdirect (loc:locs) = do checkdirect (loc:locs) = do
r <- check loc r <- check loc
if isgood r if isgood r
then ifM (goodContent key loc) then ifM (Direct.goodContent key loc)
( return r ( return r
, checkdirect locs , checkdirect locs
) )
@ -471,12 +471,12 @@ moveAnnex key src = withObjectLoc key storeobject storedirect
v <- isAnnexLink f v <- isAnnexLink f
if Just key == v if Just key == v
then do then do
updateInodeCache key src Direct.updateInodeCache key src
replaceFile f $ liftIO . moveFile src replaceFile f $ liftIO . moveFile src
chmodContent f chmodContent f
forM_ fs $ forM_ fs $
addContentWhenNotPresent key f Direct.addContentWhenNotPresent key f
else ifM (goodContent key f) else ifM (Direct.goodContent key f)
( storedirect' alreadyhave fs ( storedirect' alreadyhave fs
, storedirect' fallback fs , storedirect' fallback fs
) )
@ -551,10 +551,10 @@ prepSendAnnex key = withObjectLoc key indirect direct
indirect f = return $ Just (f, return True) indirect f = return $ Just (f, return True)
direct [] = return Nothing direct [] = return Nothing
direct (f:fs) = do direct (f:fs) = do
cache <- recordedInodeCache key cache <- Direct.recordedInodeCache key
-- check that we have a good file -- check that we have a good file
ifM (sameInodeCache f cache) ifM (Direct.sameInodeCache f cache)
( return $ Just (f, sameInodeCache f cache) ( return $ Just (f, Direct.sameInodeCache f cache)
, direct fs , direct fs
) )
@ -566,7 +566,7 @@ prepSendAnnex key = withObjectLoc key indirect direct
withObjectLoc :: Key -> (FilePath -> Annex a) -> ([FilePath] -> Annex a) -> Annex a withObjectLoc :: Key -> (FilePath -> Annex a) -> ([FilePath] -> Annex a) -> Annex a
withObjectLoc key indirect direct = ifM isDirect withObjectLoc key indirect direct = ifM isDirect
( do ( do
fs <- associatedFiles key fs <- Direct.associatedFiles key
if null fs if null fs
then goindirect then goindirect
else direct fs else direct fs
@ -605,12 +605,12 @@ removeAnnex (ContentRemovalLock key) = withObjectLoc key remove removedirect
mapM_ (void . tryIO . resetPointerFile key) mapM_ (void . tryIO . resetPointerFile key)
=<< Database.Keys.getAssociatedFiles key =<< Database.Keys.getAssociatedFiles key
Database.Keys.removeInodeCaches key Database.Keys.removeInodeCaches key
removeInodeCache key Direct.removeInodeCache key
removedirect fs = do removedirect fs = do
cache <- recordedInodeCache key cache <- Direct.recordedInodeCache key
removeInodeCache key Direct.removeInodeCache key
mapM_ (resetfile cache) fs mapM_ (resetfile cache) fs
resetfile cache f = whenM (sameInodeCache f cache) $ do resetfile cache f = whenM (Direct.sameInodeCache f cache) $ do
l <- calcRepo $ gitAnnexLink f key l <- calcRepo $ gitAnnexLink f key
secureErase f secureErase f
replaceFile f $ makeAnnexLink l replaceFile f $ makeAnnexLink l
@ -713,7 +713,7 @@ getKeysPresent keyloc = do
InRepository -> case fileKey (takeFileName d) of InRepository -> case fileKey (takeFileName d) of
Nothing -> return False Nothing -> return False
Just k -> Annex.eval s $ Just k -> Annex.eval s $
anyM (goodContent k) =<< associatedFiles k anyM (Direct.goodContent k) =<< Direct.associatedFiles k
{- In order to run Annex monad actions within unsafeInterleaveIO, {- In order to run Annex monad actions within unsafeInterleaveIO,
- the current state is taken and reused. No changes made to this - the current state is taken and reused. No changes made to this

3
debian/changelog vendored
View file

@ -1,3 +1,4 @@
git-annex (6.20151225) unstable; urgency=medium
* annex.version increased to 6, but version 5 is also still supported. * annex.version increased to 6, but version 5 is also still supported.
* The upgrade to version 6 is not done fully automatically, because * The upgrade to version 6 is not done fully automatically, because
@ -8,6 +9,8 @@
* init: Configure .git/info/attributes to use git-annex as a smudge * init: Configure .git/info/attributes to use git-annex as a smudge
filter. Note that this changes the default behavior of git add in a filter. Note that this changes the default behavior of git add in a
newly initialized repository; it will add files to the annex. newly initialized repository; it will add files to the annex.
-- Joey Hess <id@joeyh.name> Tue, 08 Dec 2015 11:14:03 -0400
git-annex (5.20151208) unstable; urgency=medium git-annex (5.20151208) unstable; urgency=medium