update
This commit is contained in:
parent
81f71e57b9
commit
e29210d1dd
2 changed files with 17 additions and 6 deletions
17
Commands.hs
17
Commands.hs
|
@ -86,7 +86,7 @@ usage = usageInfo header options ++ "\nSubcommands:\n" ++ cmddescs
|
||||||
indent l = " " ++ l
|
indent l = " " ++ l
|
||||||
pad n s = take (n - (length s)) $ repeat ' '
|
pad n s = take (n - (length s)) $ repeat ' '
|
||||||
|
|
||||||
{- Generate descrioptions of wanted parameters for subcommands. -}
|
{- Generate descriptions of wanted parameters for subcommands. -}
|
||||||
descWanted :: CmdWants -> String
|
descWanted :: CmdWants -> String
|
||||||
descWanted Description = "DESCRIPTION"
|
descWanted Description = "DESCRIPTION"
|
||||||
descWanted _ = "PATH ..."
|
descWanted _ = "PATH ..."
|
||||||
|
@ -187,7 +187,10 @@ getCmd file = isAnnexed file $ \(key, backend) -> do
|
||||||
then return ()
|
then return ()
|
||||||
else do
|
else do
|
||||||
showStart "get" file
|
showStart "get" file
|
||||||
getViaTmp key (Backend.retrieveKeyFile backend key)
|
ok <- getViaTmp key (Backend.retrieveKeyFile backend key)
|
||||||
|
if (ok)
|
||||||
|
then showEndOk
|
||||||
|
else showEndFail
|
||||||
|
|
||||||
{- Indicates a file's content is not wanted anymore, and should be removed
|
{- Indicates a file's content is not wanted anymore, and should be removed
|
||||||
- if it's safe to do so. -}
|
- if it's safe to do so. -}
|
||||||
|
@ -315,7 +318,15 @@ moveTo file = isAnnexed file $ \(key, backend) -> do
|
||||||
Remotes.copyToRemote remote key
|
Remotes.copyToRemote remote key
|
||||||
removeit remote key
|
removeit remote key
|
||||||
removeit remote key = do
|
removeit remote key = do
|
||||||
error $ "TODO remove" ++ file
|
error "TODO: drop key from local"
|
||||||
|
-- Update local location log; key is present
|
||||||
|
-- there and missing here.
|
||||||
|
logStatus key ValueMissing
|
||||||
|
u <- getUUID remote
|
||||||
|
liftIO $ logChange remote key u ValuePresent
|
||||||
|
-- Propigate location log to remote.
|
||||||
|
error "TODO: update remote locationlog"
|
||||||
|
showEndOk
|
||||||
|
|
||||||
{- Moves the content of an annexed file from another repository to the current
|
{- Moves the content of an annexed file from another repository to the current
|
||||||
- repository and updates locationlog information on both.
|
- repository and updates locationlog information on both.
|
||||||
|
|
6
Core.hs
6
Core.hs
|
@ -97,7 +97,7 @@ logStatus key status = do
|
||||||
{- Runs an action, passing it a temporary filename to download,
|
{- Runs an action, passing it a temporary filename to download,
|
||||||
- and if the action succeeds, moves the temp file into
|
- and if the action succeeds, moves the temp file into
|
||||||
- the annex as a key's content. -}
|
- the annex as a key's content. -}
|
||||||
getViaTmp :: Key -> (FilePath -> Annex (Bool)) -> Annex ()
|
getViaTmp :: Key -> (FilePath -> Annex Bool) -> Annex Bool
|
||||||
getViaTmp key action = do
|
getViaTmp key action = do
|
||||||
g <- Annex.gitRepo
|
g <- Annex.gitRepo
|
||||||
let dest = annexLocation g key
|
let dest = annexLocation g key
|
||||||
|
@ -108,9 +108,9 @@ getViaTmp key action = do
|
||||||
then do
|
then do
|
||||||
liftIO $ renameFile tmp dest
|
liftIO $ renameFile tmp dest
|
||||||
logStatus key ValuePresent
|
logStatus key ValuePresent
|
||||||
showEndOk
|
return True
|
||||||
else do
|
else do
|
||||||
showEndFail
|
return False
|
||||||
|
|
||||||
{- Output logging -}
|
{- Output logging -}
|
||||||
showStart :: String -> String -> Annex ()
|
showStart :: String -> String -> Annex ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue