From 63a292324d20832b68c92f784828e55e644481cc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Nov 2011 14:46:01 -0400 Subject: add a UUID type Should have done this a long time ago. --- Logs/Location.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Logs/Location.hs') diff --git a/Logs/Location.hs b/Logs/Location.hs index 8855cf63b..602c46f31 100644 --- a/Logs/Location.hs +++ b/Logs/Location.hs @@ -29,16 +29,15 @@ import Logs.Presence {- Log a change in the presence of a key's value in a repository. -} logChange :: Git.Repo -> Key -> UUID -> LogStatus -> Annex () -logChange repo key u s - | null u = error $ - "unknown UUID for " ++ Git.repoDescribe repo ++ - " (have you run git annex init there?)" - | otherwise = addLog (logFile key) =<< logNow s u +logChange _ key (UUID u) s = addLog (logFile key) =<< logNow s u +logChange repo _ NoUUID _ = error $ + "unknown UUID for " ++ Git.repoDescribe repo ++ + " (have you run git annex init there?)" {- Returns a list of repository UUIDs that, according to the log, have - the value of a key. -} keyLocations :: Key -> Annex [UUID] -keyLocations = currentLog . logFile +keyLocations key = map read <$> (currentLog . logFile) key {- Finds all keys that have location log information. - (There may be duplicate keys in the list.) -} -- cgit v1.2.3