diff --git a/Annex/Version.hs b/Annex/Version.hs index 6149e6fb73..31c6501bef 100644 --- a/Annex/Version.hs +++ b/Annex/Version.hs @@ -1,6 +1,6 @@ {- git-annex repository versioning - - - Copyright 2010 Joey Hess + - Copyright 2010,2013 Joey Hess - - Licensed under the GNU GPL version 3 or higher. -} @@ -16,8 +16,11 @@ type Version = String defaultVersion :: Version defaultVersion = "3" +directModeVersion :: Version +directModeVersion = "4" + supportedVersions :: [Version] -supportedVersions = [defaultVersion] +supportedVersions = [defaultVersion, directModeVersion] upgradableVersions :: [Version] upgradableVersions = ["0", "1", "2"] @@ -28,8 +31,8 @@ versionField = annexConfig "version" getVersion :: Annex (Maybe Version) getVersion = annexVersion <$> Annex.getGitConfig -setVersion :: Annex () -setVersion = setConfig versionField defaultVersion +setVersion :: Version -> Annex () +setVersion = setConfig versionField removeVersion :: Annex () removeVersion = unsetConfig versionField diff --git a/Command/Direct.hs b/Command/Direct.hs index 0c007bb105..d847a32701 100644 --- a/Command/Direct.hs +++ b/Command/Direct.hs @@ -14,6 +14,7 @@ import qualified Git.Command import qualified Git.LsFiles import Config import Annex.Direct +import Annex.Version def :: [Command] def = [notBareRepo $ @@ -53,4 +54,5 @@ cleanup :: CommandCleanup cleanup = do showStart "direct" "" setDirect True + setVersion directModeVersion return True diff --git a/Command/Indirect.hs b/Command/Indirect.hs index ac97be753f..8bf228a801 100644 --- a/Command/Indirect.hs +++ b/Command/Indirect.hs @@ -17,6 +17,7 @@ import qualified Annex import Annex.Direct import Annex.Content import Annex.CatFile +import Annex.Version import Init def :: [Command] @@ -88,6 +89,7 @@ perform = do cleanup :: CommandCleanup cleanup = do + setVersion defaultVersion showStart "indirect" "" showEndOk return True diff --git a/Command/Upgrade.hs b/Command/Upgrade.hs index b39fcd99c2..d1c1eb3b07 100644 --- a/Command/Upgrade.hs +++ b/Command/Upgrade.hs @@ -23,5 +23,5 @@ start :: CommandStart start = do showStart "upgrade" "." r <- upgrade - setVersion + setVersion defaultVersion next $ next $ return r diff --git a/Init.hs b/Init.hs index 2c1bf4ef90..358a54e818 100644 --- a/Init.hs +++ b/Init.hs @@ -42,9 +42,9 @@ genDescription Nothing = do initialize :: Maybe String -> Annex () initialize mdescription = do prepUUID + setVersion defaultVersion checkCrippledFileSystem Annex.Branch.create - setVersion gitPreCommitHookWrite createInodeSentinalFile u <- getUUID @@ -143,3 +143,4 @@ checkCrippledFileSystem = whenM (probeCrippledFileSystem) $ do maybe noop (`toDirect` f) =<< isAnnexLink f void $ liftIO clean setDirect True + setVersion directModeVersion diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs index 966b51a44b..72e105d167 100644 --- a/Upgrade/V1.hs +++ b/Upgrade/V1.hs @@ -53,14 +53,14 @@ upgrade = do ifM (fromRepo Git.repoIsLocalBare) ( do moveContent - setVersion + setVersion defaultVersion , do moveContent updateSymlinks moveLocationLogs Annex.Queue.flush - setVersion + setVersion defaultVersion ) Upgrade.V2.upgrade diff --git a/debian/changelog b/debian/changelog index 4d63ef9b80..091d16d1df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -git-annex (3.20130217) UNRELEASED; urgency=low +git-annex (4.20130217) UNRELEASED; urgency=low + * annex.version is now set to 4 for direct mode repositories. * Should now fully support git repositories with core.symlinks=false; always using git's pseudosymlink files in such repositories. * webapp: Allow creating repositories on filesystems that lack support for diff --git a/doc/upgrades.mdwn b/doc/upgrades.mdwn index c4aac53482..6cf54477cc 100644 --- a/doc/upgrades.mdwn +++ b/doc/upgrades.mdwn @@ -18,6 +18,11 @@ conflicts first before upgrading git-annex. ## Upgrade events, so far +### v3 -> v4 (git-annex version 4.x) + +v4 is only used for [[direct_mode]], and no upgrade needs to be done from +existing v3 repositories, they will continue to work. + ### v2 -> v3 (git-annex version 3.x) Involved moving the .git-annex/ directory into a separate git-annex branch.