summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-02 14:18:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-02 14:18:21 -0400
commiteec137f33a2b6982403d7dd9187500ad5a14b868 (patch)
tree9f5cf1dbf5e7be913d1f42f26d7f77943cdd2704
parent8e249ea0bdbf0b0890d6e3d3ed1e30c1df36e136 (diff)
Record uuid when auto-initializing a remote so it shows in status.
-rw-r--r--Backend/SHA.hs2
-rw-r--r--Init.hs2
-rw-r--r--Logs/UUID.hs10
-rw-r--r--debian/changelog1
4 files changed, 14 insertions, 1 deletions
diff --git a/Backend/SHA.hs b/Backend/SHA.hs
index 3f210df1f..3a54a8871 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 1fac80820..8c79002bc 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 c05c4e348..77cfb5ce0 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 b17586bc6..5beb32ee1 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 <joeyh@debian.org> Thu, 27 Oct 2011 13:58:53 -0400