avoid --all buffering list of all keys
In Annex.Branch.branch, the (++) was killing laziness. Rewrote so it streams lazily. filterM also kills laziness, so made loggedKeys use a Unchecked type, and check if the key is dead in the seek loop. Note that loggedKeysFor still buffers, so git-annex info <remote> and git-annex unused --from remote still use more memory than necessary. Also removed some unused functions from Annex.Journal.
This commit is contained in:
parent
a8c91ce69a
commit
bea0ad220a
6 changed files with 52 additions and 44 deletions
|
@ -55,27 +55,6 @@ getJournalFileStale :: FilePath -> Annex (Maybe String)
|
|||
getJournalFileStale file = inRepo $ \g -> catchMaybeIO $
|
||||
readFileStrict $ journalFile file g
|
||||
|
||||
{- List of files that have updated content in the journal. -}
|
||||
getJournalledFiles :: JournalLocked -> Annex [FilePath]
|
||||
getJournalledFiles jl = map fileJournal <$> getJournalFiles jl
|
||||
|
||||
getJournalledFilesStale :: Annex [FilePath]
|
||||
getJournalledFilesStale = map fileJournal <$> getJournalFilesStale
|
||||
|
||||
{- List of existing journal files. -}
|
||||
getJournalFiles :: JournalLocked -> Annex [FilePath]
|
||||
getJournalFiles _jl = getJournalFilesStale
|
||||
|
||||
{- List of existing journal files, but without locking, may miss new ones
|
||||
- just being added, or may have false positives if the journal is staged
|
||||
- as it is run. -}
|
||||
getJournalFilesStale :: Annex [FilePath]
|
||||
getJournalFilesStale = do
|
||||
g <- gitRepo
|
||||
fs <- liftIO $ catchDefaultIO [] $
|
||||
getDirectoryContents $ gitAnnexJournalDir g
|
||||
return $ filter (`notElem` [".", ".."]) fs
|
||||
|
||||
withJournalHandle :: (DirectoryHandle -> IO a) -> Annex a
|
||||
withJournalHandle a = do
|
||||
d <- fromRepo gitAnnexJournalDir
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue