summaryrefslogtreecommitdiff
path: root/Types
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2019-01-14 13:03:35 -0400
committerJoey Hess <joeyh@joeyh.name>2019-01-14 13:03:35 -0400
commitd3ab5e626b0614c209fffead77d27e40f599ead8 (patch)
treedc0fd9538267de416cd04457897628ce52580ffd /Types
parentff0a2bee2d4ee93afe8882f44b4cae2c29f0420a (diff)
rename key2file and file2key
What these generate is not really suitable to be used as a filename, which is why keyFile and fileKey further escape it. These are just serializing Keys. Also removed a quickcheck test that was very unlikely to test anything useful, since it relied on random chance creating something that looks like a serialized key. The other test is sufficient for testing what that was intended to test anyway.
Diffstat (limited to 'Types')
-rw-r--r--Types/ActionItem.hs4
-rw-r--r--Types/Distribution.hs4
2 files changed, 4 insertions, 4 deletions
diff --git a/Types/ActionItem.hs b/Types/ActionItem.hs
index 73d8451017..f8151018a6 100644
--- a/Types/ActionItem.hs
+++ b/Types/ActionItem.hs
@@ -36,8 +36,8 @@ instance MkActionItem (Transfer, TransferInfo) where
actionItemDesc :: ActionItem -> Key -> String
actionItemDesc (ActionItemAssociatedFile (AssociatedFile (Just f))) _ = f
-actionItemDesc (ActionItemAssociatedFile (AssociatedFile Nothing)) k = key2file k
-actionItemDesc ActionItemKey k = key2file k
+actionItemDesc (ActionItemAssociatedFile (AssociatedFile Nothing)) k = serializeKey k
+actionItemDesc ActionItemKey k = serializeKey k
actionItemDesc (ActionItemBranchFilePath bfp) _ = descBranchFilePath bfp
actionItemDesc (ActionItemFailedTransfer _ i) k =
actionItemDesc (ActionItemAssociatedFile (associatedFile i)) k
diff --git a/Types/Distribution.hs b/Types/Distribution.hs
index d19074bf95..6ef3e766b9 100644
--- a/Types/Distribution.hs
+++ b/Types/Distribution.hs
@@ -46,7 +46,7 @@ parseInfoFile s = case lines s of
formatGitAnnexDistribution :: GitAnnexDistribution -> String
formatGitAnnexDistribution d = unlines
[ distributionUrl d
- , key2file (distributionKey d)
+ , serializeKey (distributionKey d)
, distributionVersion d
, show (distributionReleasedate d)
, maybe "" show (distributionUrgentUpgrade d)
@@ -56,7 +56,7 @@ parseGitAnnexDistribution :: String -> Maybe GitAnnexDistribution
parseGitAnnexDistribution s = case lines s of
(u:k:v:d:uu:_) -> GitAnnexDistribution
<$> pure u
- <*> file2key k
+ <*> deserializeKey k
<*> pure v
<*> readish d
<*> pure (readish uu)