diff options
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Content.hs | 5 | ||||
-rw-r--r-- | Annex/Content/Direct.hs | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index 0439cb367..673e59b10 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -276,6 +276,10 @@ replaceFile file a = do - In direct mode, it's possible for the file to change as it's being sent. - If this happens, runs the rollback action and returns False. The - rollback action should remove the data that was transferred. + - + - Note that the returned action is, in some cases, run in the Annex monad + - of the remote that is receiving the object, rather than the sender. + - So it cannot rely on Annex state, particular -} sendAnnex :: Key -> Annex () -> (FilePath -> Annex Bool) -> Annex Bool sendAnnex key rollback sendobject = go =<< prepSendAnnex key @@ -303,6 +307,7 @@ prepSendAnnex key = withObjectLoc key indirect direct direct [] = return Nothing direct (f:fs) = do cache <- recordedInodeCache key + liftIO $ print ("prepSendAnnex pre cache", cache) -- check that we have a good file ifM (sameInodeCache f cache) ( return $ Just (f, sameInodeCache f cache) diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs index bbf6e310d..523e15f18 100644 --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -150,8 +150,12 @@ compareInodeCaches :: InodeCache -> InodeCache -> Annex Bool compareInodeCaches x y | compareStrong x y = return True | otherwise = ifM inodesChanged - ( return $ compareWeak x y - , return False + ( do + liftIO $ print ("compareInodeCaches weak") + return $ compareWeak x y + , do + liftIO $ print ("compareInodeCaches no inode change but cache not match") + return False ) compareInodeCachesWith :: Annex InodeComparisonType @@ -171,9 +175,11 @@ inodesChanged = maybe calc return =<< Annex.getState Annex.inodeschanged scache <- liftIO . genInodeCache =<< fromRepo gitAnnexInodeSentinal scached <- readInodeSentinalFile + liftIO $ print (scache, scached) let changed = case (scache, scached) of (Just c1, Just c2) -> not $ compareStrong c1 c2 _ -> True + liftIO $ print changed Annex.changeState $ \s -> s { Annex.inodeschanged = Just changed } return changed |