summaryrefslogtreecommitdiff
path: root/Logs/UUID.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Logs/UUID.hs')
-rw-r--r--Logs/UUID.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Logs/UUID.hs b/Logs/UUID.hs
index c05c4e348..77cfb5ce0 100644
--- a/Logs/UUID.hs
+++ b/Logs/UUID.hs
@@ -15,6 +15,7 @@
module Logs.UUID (
describeUUID,
+ recordUUID,
uuidMap
) where
@@ -37,6 +38,15 @@ describeUUID uuid desc = do
Annex.Branch.change logfile $
showLog id . changeLog ts uuid desc . parseLog Just
+{- Records the uuid in the log, if it's not already there. -}
+recordUUID :: UUID -> Annex ()
+recordUUID u = go . M.lookup u =<< uuidMap
+ where
+ go (Just "") = set
+ go Nothing = set
+ go _ = return ()
+ set = describeUUID u ""
+
{- Read the uuidLog into a simple Map.
-
- The UUID of the current repository is included explicitly, since