diff --git a/Backend/SHA.hs b/Backend/SHA.hs index 3f210df1f1..3a54a8871b 100644 --- a/Backend/SHA.hs +++ b/Backend/SHA.hs @@ -83,7 +83,7 @@ keyValue size file = do {- Extension preserving keys. -} keyValueE :: SHASize -> FilePath -> Annex (Maybe Key) -keyValueE size file = keyValue >>= maybe (return Nothing) addE +keyValueE size file = keyValue size file >>= maybe (return Nothing) addE where addE k = return $ Just $ k { keyName = keyName k ++ extension diff --git a/Init.hs b/Init.hs index 1fac80820a..8c79002bcb 100644 --- a/Init.hs +++ b/Init.hs @@ -15,6 +15,7 @@ import Common.Annex import Utility.TempFile import qualified Git import qualified Annex.Branch +import Logs.UUID import Annex.Version import Annex.UUID @@ -24,6 +25,7 @@ initialize = do Annex.Branch.create setVersion gitPreCommitHookWrite + getUUID >>= recordUUID uninitialize :: Annex () uninitialize = gitPreCommitHookUnWrite diff --git a/Logs/UUID.hs b/Logs/UUID.hs index c05c4e3481..77cfb5ce0f 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 diff --git a/debian/changelog b/debian/changelog index b17586bc68..5beb32ee1f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,7 @@ git-annex (3.20111026) UNRELEASED; urgency=low * The fromkey command now takes the key as its first parameter. The --key option is no longer used. * Built without any filename containing .git being excluded. Closes: #647215 + * Record uuid when auto-initializing a remote so it shows in status. -- Joey Hess Thu, 27 Oct 2011 13:58:53 -0400