withIndex,
precache,
UnmergedBranches(..),
+ FileContents,
overBranchFileContents,
overJournalFileContents,
combineStaleJournalWithBranch,
= UnmergedBranches t
| NoUnmergedBranches t
+type FileContents t b = Maybe (t, RawFilePath, Maybe (L.ByteString, Maybe b))
+
{- Runs an action on the content of selected files from the branch.
- This is much faster than reading the content of each file in turn,
- because it lets git cat-file stream content without blocking.
-- and in this case it's also possible for the callback to be
-- passed some of the same file content repeatedly.
-> (RawFilePath -> Maybe v)
- -> (Annex (Maybe (v, RawFilePath, Maybe (L.ByteString, Maybe Bool))) -> Annex a)
+ -> (Annex (FileContents v Bool) -> Annex a)
-> Annex (UnmergedBranches (a, Git.Sha))
overBranchFileContents ignorejournal select go = do
st <- update
overBranchFileContents'
:: (RawFilePath -> Maybe v)
- -> (Annex (Maybe (v, RawFilePath, Maybe (L.ByteString, Maybe Bool))) -> Annex a)
+ -> (Annex (FileContents v Bool) -> Annex a)
-> BranchState
-> Annex (a, Git.Sha)
overBranchFileContents' select go st = do
-- content may be stale or lack information committed to the
-- git-annex branch.
-> (RawFilePath -> Maybe v)
- -> (Annex (Maybe (v, RawFilePath, Maybe (L.ByteString, Maybe b))) -> Annex a)
+ -> (Annex (FileContents v b) -> Annex a)
-> Annex a
overJournalFileContents handlestale select go = do
buf <- liftIO newEmptyMVar
:: MVar ([RawFilePath], [RawFilePath])
-> (RawFilePath -> L.ByteString -> Annex (L.ByteString, Maybe b))
-> (RawFilePath -> Maybe a)
- -> Annex (Maybe (a, RawFilePath, (Maybe (L.ByteString, Maybe b))))
+ -> Annex (FileContents a b)
overJournalFileContents' buf handlestale select =
liftIO (tryTakeMVar buf) >>= \case
Nothing -> do
import Annex.Common
import qualified Annex.Branch
+import Annex.Branch (FileContents)
import Logs
import Logs.Presence
import Types.Cluster
overLocationLogs'
:: Bool
-> v
- -> (Annex (Maybe (Key, RawFilePath, Maybe (L.ByteString, Maybe Bool))) -> Annex v -> Annex v)
+ -> (Annex (FileContents Key Bool) -> Annex v -> Annex v)
-> (Key -> [UUID] -> v -> Annex v)
-> Annex (Annex.Branch.UnmergedBranches (v, Sha))
overLocationLogs' ignorejournal =
changedlocs _ _ _ Nothing = pure (S.empty, S.empty)
overLocationLogsHelper
- :: ( (RawFilePath -> Maybe Key)
- -> (Annex (Maybe (Key, RawFilePath, Maybe (L.ByteString, Maybe b))) -> Annex v)
- -> Annex a
- )
+ :: ((RawFilePath -> Maybe Key) -> (Annex (FileContents Key b) -> Annex v) -> Annex a)
-> ((Maybe L.ByteString -> [UUID]) -> Key -> RawFilePath -> Maybe (L.ByteString, Maybe b) -> Annex u)
-> Bool
-> v
- -> (Annex (Maybe (Key, RawFilePath, Maybe (L.ByteString, Maybe b))) -> Annex v -> Annex v)
+ -> (Annex (FileContents Key b) -> Annex v -> Annex v)
-> (Key -> u -> v -> Annex v)
-> Annex a
overLocationLogsHelper runner locparserrunner canprecache iv discarder keyaction = do