git-annex sim command is working

Had to add Read instances to Key and NumCopies and some other similar
types. I only expect to use those in serializing a sim. Of course, this
risks that implementation changes break reading old data. For a sim,
that would not be a big problem.
This commit is contained in:
Joey Hess 2024-09-12 16:07:44 -04:00
parent 7e8274c6b7
commit 52891711d2
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
10 changed files with 284 additions and 155 deletions

View file

@ -108,6 +108,7 @@ module Annex.Locations (
gitAnnexSshDir,
gitAnnexRemotesDir,
gitAnnexAssistantDefaultDir,
gitAnnexSimDir,
HashLevels(..),
hashDirMixed,
hashDirLower,
@ -675,6 +676,9 @@ gitAnnexRemotesDir r =
gitAnnexAssistantDefaultDir :: FilePath
gitAnnexAssistantDefaultDir = "annex"
gitAnnexSimDir :: Git.Repo -> RawFilePath
gitAnnexSimDir r = P.addTrailingPathSeparator $ gitAnnexDir r P.</> "sim"
{- Sanitizes a String that will be used as part of a Key's keyName,
- dealing with characters that cause problems.
-