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.
This commit is contained in:
		
					parent
					
						
							
								0de879e264
							
						
					
				
			
			
				commit
				
					
						fded408b44
					
				
			
		
					 2 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
					@ -37,6 +37,7 @@ import Command.Get (getKeyFile')
 | 
				
			||||||
import qualified Command.Move
 | 
					import qualified Command.Move
 | 
				
			||||||
import Logs.Location
 | 
					import Logs.Location
 | 
				
			||||||
import Annex.Drop
 | 
					import Annex.Drop
 | 
				
			||||||
 | 
					import Annex.UUID
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import qualified Data.Set as S
 | 
					import qualified Data.Set as S
 | 
				
			||||||
import Data.Hash.MD5
 | 
					import Data.Hash.MD5
 | 
				
			||||||
| 
						 | 
					@ -526,12 +527,15 @@ syncFile rs f (k, _) = do
 | 
				
			||||||
	locs <- loggedLocations k
 | 
						locs <- loggedLocations k
 | 
				
			||||||
	let (have, lack) = partition (\r -> Remote.uuid r `elem` locs) rs
 | 
						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)
 | 
						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,
 | 
						-- Using callCommandAction rather than commandAction for drops,
 | 
				
			||||||
	-- because a failure to drop does not mean the sync failed.
 | 
						-- 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
 | 
							Nothing callCommandAction
 | 
				
			||||||
  where
 | 
					  where
 | 
				
			||||||
  	wantget have = allM id 
 | 
					  	wantget have = allM id 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								debian/changelog
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/changelog
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -15,6 +15,8 @@ git-annex (5.20140128) UNRELEASED; urgency=medium
 | 
				
			||||||
  * sync --content: Reuse smart copy code from copy command, including
 | 
					  * sync --content: Reuse smart copy code from copy command, including
 | 
				
			||||||
    handling and repairing out of date location tracking info.
 | 
					    handling and repairing out of date location tracking info.
 | 
				
			||||||
    Closes: #737480
 | 
					    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
 | 
					  * Added ways to configure rsync options to be used only when uploading
 | 
				
			||||||
    or downloading from a remote. Useful to eg limit upload bandwidth.
 | 
					    or downloading from a remote. Useful to eg limit upload bandwidth.
 | 
				
			||||||
  * Document in man page that sshcaching uses ssh ControlMaster.
 | 
					  * Document in man page that sshcaching uses ssh ControlMaster.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue