summaryrefslogtreecommitdiff
path: root/Logs/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-02 14:18:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-02 14:18:21 -0400
commiteec137f33a2b6982403d7dd9187500ad5a14b868 (patch)
tree9f5cf1dbf5e7be913d1f42f26d7f77943cdd2704 /Logs/UUID.hs
parent8e249ea0bdbf0b0890d6e3d3ed1e30c1df36e136 (diff)
Record uuid when auto-initializing a remote so it shows in status.
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