Future proof activity log parsing

When the log has an activity that is not known, eg added by a future
version of git-annex, it used to be treated as no activity at all,
which would make git-annex expire think it should expire the repository,
despite it having some kind of recent activity.

Hopefully there will be no reason to add a new activity until enough
time has passed that this commit is in use everywhere.

Sponsored-by: Jake Vosloo on Patreon
This commit is contained in:
Joey Hess 2021-06-14 14:18:06 -04:00
parent 372ace599a
commit 78da00c7a6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 89 additions and 12 deletions

View file

@ -111,6 +111,6 @@ parseExpire ps = do
parseActivity :: MonadFail m => String -> m Activity
parseActivity s = case readish s of
Nothing -> Fail.fail $ "Unknown activity. Choose from: " ++
unwords (map show [minBound..maxBound :: Activity])
unwords (map show allActivities)
Just v -> return v