convert git-annex branch access to ByteStrings and Builders
Most of the individual logs are not converted yet, only presense logs have an efficient ByteString Builder implemented so far. The rest convert to and from String.
This commit is contained in:
parent
53905490df
commit
bfc9039ead
27 changed files with 163 additions and 120 deletions
|
@ -25,14 +25,14 @@ recordDifferences :: Differences -> UUID -> Annex ()
|
|||
recordDifferences ds@(Differences {}) uuid = do
|
||||
c <- liftIO currentVectorClock
|
||||
Annex.Branch.change differenceLog $
|
||||
showLog id . changeLog c uuid (showDifferences ds) . parseLog Just
|
||||
encodeBL . showLog id . changeLog c uuid (showDifferences ds) . parseLog Just . decodeBL
|
||||
recordDifferences UnknownDifferences _ = return ()
|
||||
|
||||
-- Map of UUIDs that have Differences recorded.
|
||||
-- If a new version of git-annex has added a Difference this version
|
||||
-- doesn't know about, it will contain UnknownDifferences.
|
||||
recordedDifferences :: Annex (M.Map UUID Differences)
|
||||
recordedDifferences = parseDifferencesLog <$> Annex.Branch.get differenceLog
|
||||
recordedDifferences = parseDifferencesLog . decodeBL <$> Annex.Branch.get differenceLog
|
||||
|
||||
recordedDifferencesFor :: UUID -> Annex Differences
|
||||
recordedDifferencesFor u = fromMaybe mempty . M.lookup u
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue