reinject: Added new mode which can reinject known files into the annex.

For example: git-annex reinject --known /mnt/backup/*
This commit is contained in:
Joey Hess 2016-04-22 13:49:32 -04:00
parent f9f2576203
commit 8ab27235ea
Failed to extract signature
5 changed files with 101 additions and 26 deletions

View file

@ -19,6 +19,7 @@ module Logs.Location (
logChange,
loggedLocations,
loggedLocationsHistorical,
isKnownKey,
checkDead,
setDead,
loggedKeys,
@ -65,6 +66,13 @@ getLoggedLocations getter key = do
config <- Annex.getGitConfig
map toUUID <$> getter (locationLogFile config key)
{- Is there a location log for the key? True even for keys with no
- remaining locations. -}
isKnownKey :: Key -> Annex Bool
isKnownKey key = do
config <- Annex.getGitConfig
not . null <$> readLog (locationLogFile config key)
{- For a key to be dead, all locations that have location status for the key
- must have InfoDead set. -}
checkDead :: Key -> Annex Bool