summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-02 16:59:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-02 16:59:55 -0400
commit251c01d51e22dc295359ba1f85144afc4c178e7a (patch)
treef8b19d157e09349194ffe40591250a72c16c8f30 /Logs
parent7b08584c5553c22b322a2d9c268fda855666f4ce (diff)
dead: A command which says that a repository is gone for good and you don't want git-annex to mention it again.
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Location.hs10
-rw-r--r--Logs/Trust.hs6
2 files changed, 12 insertions, 4 deletions
diff --git a/Logs/Location.hs b/Logs/Location.hs
index cb21a2d1c..27b4d709e 100644
--- a/Logs/Location.hs
+++ b/Logs/Location.hs
@@ -27,6 +27,7 @@ module Logs.Location (
import Common.Annex
import qualified Annex.Branch
import Logs.Presence
+import Logs.Trust
{- Log a change in the presence of a key's value in a repository. -}
logChange :: Key -> UUID -> LogStatus -> Annex ()
@@ -34,9 +35,14 @@ logChange key (UUID u) s = addLog (logFile key) =<< logNow s u
logChange _ NoUUID _ = return ()
{- Returns a list of repository UUIDs that, according to the log, have
- - the value of a key. -}
+ - the value of a key.
+ -
+ - Dead repositories are skipped.
+ -}
keyLocations :: Key -> Annex [UUID]
-keyLocations key = map toUUID <$> (currentLog . logFile) key
+keyLocations key = do
+ l <- map toUUID <$> (currentLog . logFile) key
+ snd <$> trustPartition DeadTrusted l
{- Finds all keys that have location log information.
- (There may be duplicate keys in the list.) -}
diff --git a/Logs/Trust.hs b/Logs/Trust.hs
index e447fbebc..f18f42511 100644
--- a/Logs/Trust.hs
+++ b/Logs/Trust.hs
@@ -67,12 +67,14 @@ parseTrust s
w = words s
parse "1" = Trusted
parse "0" = UnTrusted
+ parse "X" = DeadTrusted
parse _ = SemiTrusted
showTrust :: TrustLevel -> String
-showTrust SemiTrusted = "?"
-showTrust UnTrusted = "0"
showTrust Trusted = "1"
+showTrust UnTrusted = "0"
+showTrust DeadTrusted = "X"
+showTrust SemiTrusted = "?"
{- Changes the trust level for a uuid in the trustLog. -}
trustSet :: UUID -> TrustLevel -> Annex ()