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

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

View file

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

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

1
debian/changelog vendored
View file

@ -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 <joeyh@debian.org> Thu, 27 Oct 2011 13:58:53 -0400