summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-06-16 15:07:03 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-06-16 15:07:03 -0400
commit7d1b4b7c8f12ca77dc0152e341906ad536c15863 (patch)
tree05b125a08a3ddcf1e8dba032928a301fc6a9a3b6
parent399dd494efb33842cfd982f2b22f326630b7244f (diff)
switch code to using associated files
-rw-r--r--Command/Sync.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 7c1ed0067..dbf16992d 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -375,11 +375,11 @@ seekSyncContent rs = do
liftIO $ not <$> isEmptyMVar mvar
where
go mvar f = ifAnnexed f
- (\v -> void (liftIO (tryPutMVar mvar ())) >> syncFile rs f v)
+ (\v -> void (liftIO (tryPutMVar mvar ())) >> syncFile rs (Just f) v)
noop
-syncFile :: [Remote] -> FilePath -> Key -> Annex ()
-syncFile rs f k = do
+syncFile :: [Remote] -> AssociatedFile -> Key -> Annex ()
+syncFile rs af k = do
locs <- loggedLocations k
let (have, lack) = partition (\r -> Remote.uuid r `elem` locs) rs
@@ -391,31 +391,31 @@ syncFile rs f k = do
-- Using callCommandAction rather than includeCommandAction for drops,
-- because a failure to drop does not mean the sync failed.
- handleDropsFrom locs' rs "unwanted" True k (Just f)
+ handleDropsFrom locs' rs "unwanted" True k af
Nothing callCommandAction
where
wantget have = allM id
[ pure (not $ null have)
, not <$> inAnnex k
- , wantGet True (Just k) (Just f)
+ , wantGet True (Just k) af
]
handleget have = ifM (wantget have)
( return [ get have ]
, return []
)
get have = includeCommandAction $ do
- showStart "get" f
- next $ next $ getViaTmp k $ \dest -> getKeyFile' k (Just f) dest have
+ showStart' "get" k af
+ next $ next $ getViaTmp k $ \dest -> getKeyFile' k af dest have
wantput r
| Remote.readonly r || remoteAnnexReadOnly (Remote.gitconfig r) = return False
- | otherwise = wantSend True (Just k) (Just f) (Remote.uuid r)
+ | otherwise = wantSend True (Just k) af (Remote.uuid r)
handleput lack = ifM (inAnnex k)
( map put <$> filterM wantput lack
, return []
)
put dest = do
ok <- includeCommandAction $ do
- showStart "copy" f
- Command.Move.toStart' dest False (Just f) k
+ showStart' "copy" k af
+ Command.Move.toStart' dest False af k
return (ok, if ok then Just (Remote.uuid dest) else Nothing)