improve version checking for v3
Do not set annex.version whenever any command is run. Just do it in init. This ensures that, if a repo has annex.version=3, it has a git-annex branch, so we don't have to run a command every time to check for the branch. Remove the old ad-hoc logic for v0 and v1, to simplify version checking.
This commit is contained in:
parent
c7a1690f02
commit
944c51ba26
4 changed files with 16 additions and 32 deletions
|
@ -9,6 +9,7 @@ module Command.Version where
|
|||
|
||||
import Control.Monad.State (liftIO)
|
||||
import Data.String.Utils
|
||||
import Data.Maybe
|
||||
|
||||
import Command
|
||||
import qualified SysConfig
|
||||
|
@ -24,7 +25,7 @@ start :: CommandStartNothing
|
|||
start = do
|
||||
liftIO $ putStrLn $ "git-annex version: " ++ SysConfig.packageversion
|
||||
v <- getVersion
|
||||
liftIO $ putStrLn $ "local repository version: " ++ v
|
||||
liftIO $ putStrLn $ "local repository version: " ++ fromMaybe "unknown" v
|
||||
liftIO $ putStrLn $ "default repository version: " ++ defaultVersion
|
||||
liftIO $ putStrLn $ "supported repository versions: " ++ vs supportedVersions
|
||||
liftIO $ putStrLn $ "upgrade supported from repository versions: " ++ vs upgradableVersions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue