Record uuid when auto-initializing a remote so it shows in status.

This commit is contained in:
Joey Hess 2011-11-02 14:18:21 -04:00
parent 8e249ea0bd
commit eec137f33a
4 changed files with 14 additions and 1 deletions

View file

@ -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