summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-30 15:17:51 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-30 15:17:51 -0400
commit59956b117da3070cc0d66e997ff3b318fb6153d4 (patch)
treec9611e5588ceb8fca860950ed89d5e59e4a3056b /Annex
parentaa74dc1ce0810c0c9e6cd6714409b98140e830c5 (diff)
temporary debugging code for windows autobuilder test suite failure
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content/Direct.hs32
1 files changed, 22 insertions, 10 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index d9e1535f3..ca1a50530 100644
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -130,9 +130,13 @@ goodContent key file = sameInodeCache file =<< recordedInodeCache key
- A key can be associated with multiple files, so may return more than
- one. -}
recordedInodeCache :: Key -> Annex [InodeCache]
-recordedInodeCache key = withInodeCacheFile key $ \f ->
- liftIO $ catchDefaultIO [] $
- mapMaybe readInodeCache . lines <$> readFileStrict f
+recordedInodeCache key = do
+ liftIO $ print ("recordedInodeCache", key, "start")
+ r <- withInodeCacheFile key $ \f ->
+ liftIO $ catchDefaultIO [] $
+ mapMaybe readInodeCache . lines <$> readFileStrict f
+ liftIO $ print ("recordedInodeCache", key, "end")
+ return r
{- Caches an inode for a file.
-
@@ -151,16 +155,24 @@ addInodeCache key cache = do
{- Writes inode cache for a key. -}
writeInodeCache :: Key -> [InodeCache] -> Annex ()
-writeInodeCache key caches = withInodeCacheFile key $ \f ->
- modifyContent f $
- liftIO $ writeFile f $
- unlines $ map showInodeCache caches
+writeInodeCache key caches = do
+ liftIO $ print ("writeInodeCache", key, "start")
+ r <- withInodeCacheFile key $ \f ->
+ modifyContent f $
+ liftIO $ writeFile f $
+ unlines $ map showInodeCache caches
+ liftIO $ print ("writeInodeCache", key, "stop")
+ return r
{- Removes an inode cache. -}
removeInodeCache :: Key -> Annex ()
-removeInodeCache key = withInodeCacheFile key $ \f ->
- modifyContent f $
- liftIO $ nukeFile f
+removeInodeCache key = do
+ liftIO $ print ("removeInodeCache", key, "start")
+ r <- withInodeCacheFile key $ \f ->
+ modifyContent f $
+ liftIO $ nukeFile f
+ liftIO $ print ("removeInodeCache", key, "stop")
+ return r
withInodeCacheFile :: Key -> (FilePath -> Annex a) -> Annex a
withInodeCacheFile key a = a =<< calcRepo (gitAnnexInodeCache key)