summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-19 18:11:47 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-19 18:11:47 -0400
commitc86a4437538833831875922d8509fb4a4dedc8ed (patch)
tree36c9db92fe7148633588b0969541791ebe2f6492
parent81b2f9968a9e2c792b5081bf58ec6d68ca6e1624 (diff)
include information about remotes just uloaded to when calling handleDropsFrom
-rw-r--r--Command/Sync.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 429a219bb..1b5082700 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -504,11 +504,13 @@ syncContent rs f (k, _) = do
locs <- loggedLocations k
let (have, lack) = partition (\r -> Remote.uuid r `elem` locs) rs
- results <- mapM run =<< concat <$> sequence
- [ handleget have
- , handleput lack
- ]
- handleDropsFrom locs rs "unwanted" True k (Just f) Nothing
+ getresults <- sequence =<< handleget have
+ (putresults, putrs) <- unzip <$> (sequence =<< handleput lack)
+
+ let locs' = catMaybes putrs ++ locs
+ handleDropsFrom locs' rs "unwanted" True k (Just f) Nothing
+
+ let results = getresults ++ putresults
if null results
then stop
else do
@@ -531,7 +533,7 @@ syncContent rs f (k, _) = do
)
get have = do
showStart "get" f
- getViaTmp k $ \dest -> getKeyFile' k (Just f) dest have
+ run $ getViaTmp k $ \dest -> getKeyFile' k (Just f) dest have
wantput r
| Remote.readonly r || remoteAnnexReadOnly (Types.Remote.gitconfig r) = return False
@@ -543,8 +545,8 @@ syncContent rs f (k, _) = do
put dest = do
showStart "copy" f
showAction $ "to " ++ Remote.name dest
- ok <- upload (Remote.uuid dest) k (Just f) noRetry $
+ ok <- run $ upload (Remote.uuid dest) k (Just f) noRetry $
Remote.storeKey dest k (Just f)
when ok $
Remote.logStatus dest k InfoPresent
- return ok
+ return (ok, if ok then Just (Remote.uuid dest) else Nothing)