No longer auto-upgrade to repository format 2, to avoid accidental upgrades, etc. Use git-annex upgrade when you're ready to run this version.

This commit is contained in:
Joey Hess 2011-03-19 18:33:39 -04:00
parent 43b3675d42
commit 6a2a17658c
8 changed files with 32 additions and 20 deletions

View file

@ -22,7 +22,7 @@ import qualified GitQueue
import Types
import Command
import BackendList
import Upgrade
import Version
import Options
import Messages
import UUID
@ -33,7 +33,7 @@ dispatch gitrepo args cmds options header = do
setupConsole
state <- Annex.new gitrepo allBackends
(actions, state') <- Annex.run state $ parseCmd args header cmds options
tryRun state' $ [startup, upgrade] ++ actions ++ [shutdown]
tryRun state' $ [startup] ++ actions ++ [shutdown]
{- Parses command line, stores configure flags, and returns a
- list of actions to be run in the Annex monad. -}
@ -93,6 +93,7 @@ tryRun' _ errnum [] = do
startup :: Annex Bool
startup = do
prepUUID
checkVersion
return True
{- Cleanup actions. -}

View file

@ -13,7 +13,6 @@ import Data.String.Utils
import Command
import qualified SysConfig
import Version
import Upgrade
command :: [Command]
command = [Command "version" paramNothing seek "show versions"]

View file

@ -12,9 +12,6 @@ import Version
import qualified Upgrade.V0
import qualified Upgrade.V1
upgradableVersions :: [Version]
upgradableVersions = ["0", "1"]
{- Uses the annex.version git config setting to automate upgrades. -}
upgrade :: Annex Bool
upgrade = do
@ -22,5 +19,4 @@ upgrade = do
case version of
"0" -> Upgrade.V0.upgrade
"1" -> Upgrade.V1.upgrade
v | v `elem` supportedVersions -> return True
_ -> error "this version of git-annex is too old for this git repository!"
_ -> return True

View file

@ -8,6 +8,7 @@
module Version where
import Control.Monad.State (liftIO)
import Control.Monad (unless)
import System.Directory
import Types
@ -23,6 +24,9 @@ defaultVersion = "2"
supportedVersions :: [Version]
supportedVersions = [defaultVersion]
upgradableVersions :: [Version]
upgradableVersions = ["0", "1"]
versionField :: String
versionField = "annex.version"
@ -51,3 +55,15 @@ getVersion = do
setVersion :: Annex ()
setVersion = Annex.setConfig versionField defaultVersion
checkVersion :: Annex ()
checkVersion = do
v <- getVersion
unless (v `elem` supportedVersions) $ do
error $ "Repository version " ++ v ++
" is not supported. " ++
msg v
where
msg v
| v `elem` upgradableVersions = "Upgrade this repository: git-annex upgrade"
| otherwise = "Upgrade git-annex."

5
debian/NEWS vendored
View file

@ -2,10 +2,7 @@ git-annex (0.20110316) experimental; urgency=low
This version reorganises the layout of git-annex's files in your repository.
There is an upgrade process to convert a repository from the old git-annex
to this version. While git-annex will attempt to transparently handle
upgrades, you may want to drive the upgrade process by hand.
See <http://git-annex.branchable.com/upgrades/> or
to this version. See <http://git-annex.branchable.com/upgrades/> or
/usr/share/doc/git-annex/html/upgrades.html
-- Joey Hess <joeyh@debian.org> Wed, 16 Mar 2011 15:49:15 -0400

3
debian/changelog vendored
View file

@ -4,6 +4,9 @@ git-annex (0.20110317) UNRELEASED; urgency=low
* Fix support for remotes with '.' in their names.
* Add version command to show git-annex version as well as repository
version information.
* No longer auto-upgrade to repository format 2, to avoid accidental
upgrades, etc. Use git-annex upgrade when you're ready to run this
version.
-- Joey Hess <joeyh@debian.org> Thu, 17 Mar 2011 11:46:53 -0400

View file

@ -7,4 +7,7 @@
These are good examples; I think you've convinced me at least for upgrades going forward after v2. I'm not sure we have enough users and outdated git-annex installations to worry about it for v1.
(Hoping such upgrades are rare anyway.. Part of the point of changes made in v2 was to allow lots of changes to be made later w/o needing a v3.)
Update: Upgrades from v1 to v2 will no longer be handled automatically
now.
"""]]

View file

@ -9,15 +9,14 @@ git-annex, and might want to use them with a newer git-annex.
## Upgrade process
git-annex will automatically notice if it is run in a repository that
needs an upgrade, and perform the upgrade before running whatever it
was asked to do. Or you can use the "git annex upgrade" command to
explicitly do an upgrade. The upgrade can tend to take a while,
if you have a lot of files.
git-annex will notice if it is run in a repository that
needs an upgrade, and refuse to do anything. To upgrade,
use the "git annex upgrade" command. The upgrade can tend
to take a while, if you have a lot of files.
Each clone of a repository should be individually upgraded.
Until a repository's remotes have been upgraded, git-annex
may refuse to communicate with them.
will refuse to communicate with them.
Generally, start by upgrading one repository, and then you can commit
the changes git-annex staged during upgrade, and push them out to other
@ -54,8 +53,6 @@ Symlinks changed.
Also, hashing was added to location log files in .git-annex/.
And .gitattributes needed to have another line added to it.
Handled transparently.
### v0 -> v1 (git-annex version 0.03 to version 0.04)
Involved a reorganisation of the layout of .git/annex/. Symlinks changed.