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:
parent
ceb887d826
commit
cdbcd6f495
17 changed files with 272 additions and 139 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -40,5 +40,5 @@ perform key = do
|
|||
|
||||
cleanup :: Key -> CommandCleanup
|
||||
cleanup key = do
|
||||
logStatus key ValueMissing
|
||||
logStatus key InfoMissing
|
||||
return True
|
||||
|
|
|
@ -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, " ++
|
||||
|
|
|
@ -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.
|
||||
-
|
||||
|
|
|
@ -46,5 +46,5 @@ perform file = do
|
|||
cleanup :: CommandCleanup
|
||||
cleanup = do
|
||||
key <- cmdlineKey
|
||||
logStatus key ValuePresent
|
||||
logStatus key InfoPresent
|
||||
return True
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -10,7 +10,7 @@ module Command.Whereis where
|
|||
import LocationLog
|
||||
import Command
|
||||
import Messages
|
||||
import UUID
|
||||
import Remote
|
||||
import Types
|
||||
|
||||
command :: [Command]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue