export: Deprecated the --tracking option.
Instead, users can configure remote.<name>.annex-tracking-branch themselves.
This commit is contained in:
		
					parent
					
						
							
								d805401708
							
						
					
				
			
			
				commit
				
					
						4747fa923d
					
				
			
		
					 5 changed files with 18 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -4,6 +4,9 @@ git-annex (7.20190220) UNRELEASED; urgency=medium
 | 
			
		|||
    (Reversion introduced in version 7.20190122.)
 | 
			
		||||
  * Sped up git-annex export in repositories with lots of keys.
 | 
			
		||||
  * Fix cleanup of git-annex:export.log after git-annex forget --drop-dead.
 | 
			
		||||
  * export: Deprecated the --tracking option.
 | 
			
		||||
    Instead, users can configure remote.<name>.annex-tracking-branch
 | 
			
		||||
    themselves.
 | 
			
		||||
 | 
			
		||||
 -- Joey Hess <id@joeyh.name>  Wed, 20 Feb 2019 14:20:59 -0400
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,7 +58,7 @@ optParser _ = ExportOptions
 | 
			
		|||
		)
 | 
			
		||||
	parsetracking = switch
 | 
			
		||||
		( long "tracking"
 | 
			
		||||
		<> help ("track changes to the " ++ paramTreeish)
 | 
			
		||||
		<> help ("track changes to the " ++ paramTreeish ++ " (deprecated)")
 | 
			
		||||
		)
 | 
			
		||||
 | 
			
		||||
-- To handle renames which swap files, the exported file is first renamed
 | 
			
		||||
| 
						 | 
				
			
			@ -73,7 +73,7 @@ seek o = do
 | 
			
		|||
	unlessM (isExportSupported r) $
 | 
			
		||||
		giveup "That remote does not support exports."
 | 
			
		||||
	when (exportTracking o) $
 | 
			
		||||
		setConfig (remoteConfig r "export-tracking")
 | 
			
		||||
		setConfig (remoteConfig r "annex-tracking-branch")
 | 
			
		||||
			(fromRef $ exportTreeish o)
 | 
			
		||||
	new <- fromMaybe (giveup "unknown tree") <$>
 | 
			
		||||
		-- Dereference the tree pointed to by the branch, commit,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -680,8 +680,8 @@ syncFile ebloom rs af k = onlyActionOn' k $ do
 | 
			
		|||
	put dest = includeCommandAction $ 
 | 
			
		||||
		Command.Move.toStart' dest Command.Move.RemoveNever af k (mkActionItem af)
 | 
			
		||||
 | 
			
		||||
{- When a remote has an export-tracking branch, change the export to
 | 
			
		||||
 - follow the current content of the branch. Otherwise, transfer any files
 | 
			
		||||
{- When a remote has an annex-tracking-branch configuration, change the export
 | 
			
		||||
 - to contain the current content of the branch. Otherwise, transfer any files
 | 
			
		||||
 - that were part of an export but are not in the remote yet.
 | 
			
		||||
 - 
 | 
			
		||||
 - Returns True if any file transfers were made.
 | 
			
		||||
| 
						 | 
				
			
			@ -691,7 +691,7 @@ seekExportContent rs (currbranch, _) = or <$> forM rs go
 | 
			
		|||
  where
 | 
			
		||||
	go r = withExclusiveLock (gitAnnexExportLock (Remote.uuid r)) $ do
 | 
			
		||||
		db <- Export.openDb (Remote.uuid r)
 | 
			
		||||
		exported <- case remoteAnnexExportTracking (Remote.gitconfig r) of
 | 
			
		||||
		exported <- case remoteAnnexTrackingBranch (Remote.gitconfig r) of
 | 
			
		||||
			Nothing -> nontracking r
 | 
			
		||||
			Just b -> do
 | 
			
		||||
				mcur <- inRepo $ Git.Ref.tree b
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -88,9 +88,11 @@ headExists repo = do
 | 
			
		|||
sha :: Branch -> Repo -> IO (Maybe Sha)
 | 
			
		||||
sha branch repo = process <$> showref repo
 | 
			
		||||
  where
 | 
			
		||||
	showref = pipeReadStrict [Param "show-ref",
 | 
			
		||||
		Param "--hash", -- get the hash
 | 
			
		||||
		Param $ fromRef branch]
 | 
			
		||||
	showref = pipeReadStrict
 | 
			
		||||
		[ Param "show-ref"
 | 
			
		||||
		, Param "--hash" -- get the hash
 | 
			
		||||
		, Param $ fromRef branch
 | 
			
		||||
		]
 | 
			
		||||
	process [] = Nothing
 | 
			
		||||
	process s = Just $ Ref $ firstLine s
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -231,7 +231,7 @@ data RemoteGitConfig = RemoteGitConfig
 | 
			
		|||
	, remoteAnnexReadOnly :: Bool
 | 
			
		||||
	, remoteAnnexVerify :: Bool
 | 
			
		||||
	, remoteAnnexCheckUUID :: Bool
 | 
			
		||||
	, remoteAnnexExportTracking :: Maybe Git.Ref
 | 
			
		||||
	, remoteAnnexTrackingBranch :: Maybe Git.Ref
 | 
			
		||||
	, remoteAnnexTrustLevel :: Maybe String
 | 
			
		||||
	, remoteAnnexStartCommand :: Maybe String
 | 
			
		||||
	, remoteAnnexStopCommand :: Maybe String
 | 
			
		||||
| 
						 | 
				
			
			@ -287,8 +287,10 @@ extractRemoteGitConfig r remotename = do
 | 
			
		|||
		, remoteAnnexReadOnly = getbool "readonly" False
 | 
			
		||||
		, remoteAnnexCheckUUID = getbool "checkuuid" True
 | 
			
		||||
		, remoteAnnexVerify = getbool "verify" True
 | 
			
		||||
		, remoteAnnexExportTracking = Git.Ref
 | 
			
		||||
			<$> notempty (getmaybe "export-tracking")
 | 
			
		||||
		, remoteAnnexTrackingBranch = Git.Ref <$>
 | 
			
		||||
			( notempty (getmaybe "annex-tracking-branch")
 | 
			
		||||
			<|> notempty (getmaybe "export-tracking") -- old name
 | 
			
		||||
			)
 | 
			
		||||
		, remoteAnnexTrustLevel = notempty $ getmaybe "trustlevel"
 | 
			
		||||
		, remoteAnnexStartCommand = notempty $ getmaybe "start-command"
 | 
			
		||||
		, remoteAnnexStopCommand = notempty $ getmaybe "stop-command"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue