summaryrefslogtreecommitdiff
path: root/Logs/UUID.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-10-28 19:49:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-10-28 19:49:01 -0400
commitab738a403a0b5f34b9c679c6c9a92b279babdf42 (patch)
tree3a472369032dd2bc764ffb60b09503f5e72e82be /Logs/UUID.hs
parent6c31e3a8c3c5ab92ca2e84b4c166f32d02a50f4f (diff)
status: Now always shows the current repository, even when it does not appear in uuid.log.
Diffstat (limited to 'Logs/UUID.hs')
-rw-r--r--Logs/UUID.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/Logs/UUID.hs b/Logs/UUID.hs
index 8a93b43fe..c05c4e348 100644
--- a/Logs/UUID.hs
+++ b/Logs/UUID.hs
@@ -24,6 +24,7 @@ import Data.Time.Clock.POSIX
import Common.Annex
import qualified Annex.Branch
import Logs.UUIDBased
+import qualified Annex.UUID
{- Filename of uuid.log. -}
logfile :: FilePath
@@ -36,6 +37,14 @@ describeUUID uuid desc = do
Annex.Branch.change logfile $
showLog id . changeLog ts uuid desc . parseLog Just
-{- Read the uuidLog into a simple Map -}
+{- Read the uuidLog into a simple Map.
+ -
+ - The UUID of the current repository is included explicitly, since
+ - it may not have been described and so otherwise would not appear. -}
uuidMap :: Annex (M.Map UUID String)
-uuidMap = (simpleMap . parseLog Just) <$> Annex.Branch.get logfile
+uuidMap = do
+ m <- (simpleMap . parseLog Just) <$> Annex.Branch.get logfile
+ u <- Annex.UUID.getUUID
+ return $ M.insertWith' preferold u "" m
+ where
+ preferold = flip const