v5 for direct mode, with automatic upgrade

This includes storing the current state of the HEAD ref, which git annex
sync is going to need, but does not make sync use it.
This commit is contained in:
Joey Hess 2013-11-05 16:42:59 -04:00
parent 04768e44b2
commit 4510819215
13 changed files with 138 additions and 32 deletions

View file

@ -11,6 +11,7 @@ import Common.Annex
import Command
import Upgrade
import Annex.Version
import Config
def :: [Command]
def = [dontCheck repoExists $ -- because an old version may not seem to exist
@ -23,6 +24,9 @@ seek = [withNothing start]
start :: CommandStart
start = do
showStart "upgrade" "."
r <- upgrade
setVersion defaultVersion
r <- upgrade False
ifM isDirect
( setVersion directModeVersion
, setVersion defaultVersion
)
next $ next $ return r