annex.backend is the new name for what was annex.backends
It takes a single key-value backend, rather than the unncessary and confusing list. The old option still works if set. Simplified some old old code too. This commit was sponsored by Thomas Hochstein on Patreon.
This commit is contained in:
parent
935b48a7bb
commit
4c1e3210fa
9 changed files with 82 additions and 49 deletions
|
@ -36,15 +36,13 @@ start file key = do
|
|||
Nothing -> stop
|
||||
Just oldbackend -> do
|
||||
exists <- inAnnex key
|
||||
newbackend <- choosebackend =<< chooseBackend file
|
||||
newbackend <- maybe defaultBackend return
|
||||
=<< chooseBackend file
|
||||
if (newbackend /= oldbackend || upgradableKey oldbackend key || forced) && exists
|
||||
then do
|
||||
showStart "migrate" file
|
||||
next $ perform file key oldbackend newbackend
|
||||
else stop
|
||||
where
|
||||
choosebackend Nothing = Prelude.head <$> orderedList
|
||||
choosebackend (Just backend) = return backend
|
||||
|
||||
{- Checks if a key is upgradable to a newer representation.
|
||||
-
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue