Record uuid when auto-initializing a remote so it shows in status.
This commit is contained in:
parent
8e249ea0bd
commit
eec137f33a
4 changed files with 14 additions and 1 deletions
|
@ -83,7 +83,7 @@ keyValue size file = do
|
||||||
|
|
||||||
{- Extension preserving keys. -}
|
{- Extension preserving keys. -}
|
||||||
keyValueE :: SHASize -> FilePath -> Annex (Maybe Key)
|
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
|
where
|
||||||
addE k = return $ Just $ k
|
addE k = return $ Just $ k
|
||||||
{ keyName = keyName k ++ extension
|
{ keyName = keyName k ++ extension
|
||||||
|
|
2
Init.hs
2
Init.hs
|
@ -15,6 +15,7 @@ import Common.Annex
|
||||||
import Utility.TempFile
|
import Utility.TempFile
|
||||||
import qualified Git
|
import qualified Git
|
||||||
import qualified Annex.Branch
|
import qualified Annex.Branch
|
||||||
|
import Logs.UUID
|
||||||
import Annex.Version
|
import Annex.Version
|
||||||
import Annex.UUID
|
import Annex.UUID
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ initialize = do
|
||||||
Annex.Branch.create
|
Annex.Branch.create
|
||||||
setVersion
|
setVersion
|
||||||
gitPreCommitHookWrite
|
gitPreCommitHookWrite
|
||||||
|
getUUID >>= recordUUID
|
||||||
|
|
||||||
uninitialize :: Annex ()
|
uninitialize :: Annex ()
|
||||||
uninitialize = gitPreCommitHookUnWrite
|
uninitialize = gitPreCommitHookUnWrite
|
||||||
|
|
10
Logs/UUID.hs
10
Logs/UUID.hs
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
module Logs.UUID (
|
module Logs.UUID (
|
||||||
describeUUID,
|
describeUUID,
|
||||||
|
recordUUID,
|
||||||
uuidMap
|
uuidMap
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
@ -37,6 +38,15 @@ describeUUID uuid desc = do
|
||||||
Annex.Branch.change logfile $
|
Annex.Branch.change logfile $
|
||||||
showLog id . changeLog ts uuid desc . parseLog Just
|
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.
|
{- Read the uuidLog into a simple Map.
|
||||||
-
|
-
|
||||||
- The UUID of the current repository is included explicitly, since
|
- The UUID of the current repository is included explicitly, since
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -18,6 +18,7 @@ git-annex (3.20111026) UNRELEASED; urgency=low
|
||||||
* The fromkey command now takes the key as its first parameter. The --key
|
* The fromkey command now takes the key as its first parameter. The --key
|
||||||
option is no longer used.
|
option is no longer used.
|
||||||
* Built without any filename containing .git being excluded. Closes: #647215
|
* 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
|
-- Joey Hess <joeyh@debian.org> Thu, 27 Oct 2011 13:58:53 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue