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