diff options
author | 2014-02-02 22:46:55 -0400 | |
---|---|---|
committer | 2014-02-02 22:48:45 -0400 | |
commit | 6dbf044223969e37b5b4aa495f4ffa86b51d7596 (patch) | |
tree | 6c6e1ee1265f7ac6da4918c063598a53aa82902d | |
parent | 2fdc2e9d5569f41281b5458c7a6efe767dc81864 (diff) |
sync --content: Drop files from remotes that don't have them after getting them.
Need to include the uuid of the local repo in the list of belived locations
of a key after getting it, in order for the drop from remote to include it
in the numcopies calculation.
-rw-r--r-- | Command/Sync.hs | 8 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index 0507fd680..c9493b2a4 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -37,6 +37,7 @@ import Command.Get (getKeyFile') import qualified Command.Move import Logs.Location import Annex.Drop +import Annex.UUID import qualified Data.Set as S import Data.Hash.MD5 @@ -526,12 +527,15 @@ syncFile rs f (k, _) = do locs <- loggedLocations k let (have, lack) = partition (\r -> Remote.uuid r `elem` locs) rs - sequence_ =<< handleget have + got <- anyM id =<< handleget have putrs <- catMaybes . snd . unzip <$> (sequence =<< handleput lack) + u <- getUUID + let locs' = concat [if got then [u] else [], putrs, locs] + -- Using callCommandAction rather than commandAction for drops, -- because a failure to drop does not mean the sync failed. - handleDropsFrom (putrs ++ locs) rs "unwanted" True k (Just f) + handleDropsFrom locs' rs "unwanted" True k (Just f) Nothing callCommandAction where wantget have = allM id diff --git a/debian/changelog b/debian/changelog index ab239d462..f4c8a1ac7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ git-annex (5.20140128) UNRELEASED; urgency=medium * sync --content: Reuse smart copy code from copy command, including handling and repairing out of date location tracking info. Closes: #737480 + * sync --content: Drop files from remotes that don't have them after + getting them. * Added ways to configure rsync options to be used only when uploading or downloading from a remote. Useful to eg limit upload bandwidth. * Document in man page that sshcaching uses ssh ControlMaster. |