add web special remote

Generalized LocationLog to PresenceLog, and use a presence log to record
urls for the web special remote.
This commit is contained in:
Joey Hess 2011-07-01 15:24:07 -04:00
parent ceb887d826
commit cdbcd6f495
17 changed files with 272 additions and 139 deletions

View file

@ -51,7 +51,7 @@ perform (file, backend) = do
cleanup :: FilePath -> Key -> CommandCleanup
cleanup file key = do
logStatus key ValuePresent
logStatus key InfoPresent
link <- calcGitLink file key
liftIO $ createSymbolicLink link file

View file

@ -45,5 +45,5 @@ perform key backend numcopies = do
cleanup :: Key -> CommandCleanup
cleanup key = do
whenM (inAnnex key) $ removeAnnex key
logStatus key ValueMissing
logStatus key InfoMissing
return True

View file

@ -40,5 +40,5 @@ perform key = do
cleanup :: Key -> CommandCleanup
cleanup key = do
logStatus key ValueMissing
logStatus key InfoMissing
return True

View file

@ -64,11 +64,11 @@ verifyLocationLog key file = do
case (present, u `elem` uuids) of
(True, False) -> do
fix g u ValuePresent
fix g u InfoPresent
-- There is no data loss, so do not fail.
return True
(False, True) -> do
fix g u ValueMissing
fix g u InfoMissing
warning $
"** Based on the location log, " ++ file
++ "\n** was expected to be present, " ++

View file

@ -58,7 +58,7 @@ remoteHasKey remote key present = do
g <- Annex.gitRepo
logChange g key remoteuuid status
where
status = if present then ValuePresent else ValueMissing
status = if present then InfoPresent else InfoMissing
{- Moves (or copies) the content of an annexed file to a remote.
-

View file

@ -46,5 +46,5 @@ perform file = do
cleanup :: CommandCleanup
cleanup = do
key <- cmdlineKey
logStatus key ValuePresent
logStatus key InfoPresent
return True

View file

@ -65,7 +65,7 @@ cleanup file key = do
liftIO $ createDirectoryIfMissing True (parentDir file)
fromAnnex key file
logStatus key ValueMissing
logStatus key InfoMissing
-- Commit staged changes at end to avoid confusing the
-- pre-commit hook if this file is later added back to

View file

@ -10,7 +10,7 @@ module Command.Whereis where
import LocationLog
import Command
import Messages
import UUID
import Remote
import Types
command :: [Command]