summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Init.hs18
-rw-r--r--Annex/MakeRepo.hs2
-rw-r--r--Annex/Version.hs9
3 files changed, 17 insertions, 12 deletions
diff --git a/Annex/Init.hs b/Annex/Init.hs
index 997312c31..99bb03e92 100644
--- a/Annex/Init.hs
+++ b/Annex/Init.hs
@@ -57,8 +57,8 @@ genDescription Nothing = do
return $ concat [hostname, ":", reldir]
#endif
-initialize :: Maybe String -> Annex ()
-initialize mdescription = do
+initialize :: Maybe String -> Maybe Version -> Annex ()
+initialize mdescription mversion = do
{- Has to come before any commits are made as the shared
- clone heuristic expects no local objects. -}
sharedclone <- checkSharedClone
@@ -68,7 +68,7 @@ initialize mdescription = do
ensureCommit $ Annex.Branch.create
prepUUID
- initialize'
+ initialize' mversion
initSharedClone sharedclone
@@ -77,16 +77,18 @@ initialize mdescription = do
-- Everything except for uuid setup, shared clone setup, and initial
-- description.
-initialize' :: Annex ()
-initialize' = do
+initialize' :: Maybe Version -> Annex ()
+initialize' mversion = do
checkLockSupport
checkFifoSupport
checkCrippledFileSystem
unlessM isBare $
hookWrite preCommitHook
setDifferences
- setVersion currentVersion
- configureSmudgeFilter
+ unlessM (isJust <$> getVersion) $
+ setVersion (fromMaybe defaultVersion mversion)
+ whenM versionSupportsUnlockedPointers
+ configureSmudgeFilter
ifM (crippledFileSystem <&&> not <$> isBare)
( do
enableDirectMode
@@ -115,7 +117,7 @@ ensureInitialized :: Annex ()
ensureInitialized = getVersion >>= maybe needsinit checkUpgrade
where
needsinit = ifM Annex.Branch.hasSibling
- ( initialize Nothing
+ ( initialize Nothing Nothing
, error "First run: git-annex init"
)
diff --git a/Annex/MakeRepo.hs b/Annex/MakeRepo.hs
index 73443c43d..adf49ed2c 100644
--- a/Annex/MakeRepo.hs
+++ b/Annex/MakeRepo.hs
@@ -75,7 +75,7 @@ initRepo False _ dir desc mgroup = inDir dir $ do
initRepo' :: Maybe String -> Maybe StandardGroup -> Annex ()
initRepo' desc mgroup = unlessM isInitialized $ do
- initialize desc
+ initialize desc Nothing
u <- getUUID
maybe noop (defaultStandardGroup u) mgroup
{- Ensure branch gets committed right away so it is
diff --git a/Annex/Version.hs b/Annex/Version.hs
index 4c2a990fa..b54fb68e0 100644
--- a/Annex/Version.hs
+++ b/Annex/Version.hs
@@ -15,11 +15,14 @@ import qualified Annex
type Version = String
-currentVersion :: Version
-currentVersion = "6"
+defaultVersion :: Version
+defaultVersion = "5"
+
+latestVersion :: Version
+latestVersion = "6"
supportedVersions :: [Version]
-supportedVersions = ["5", currentVersion]
+supportedVersions = ["5", "6"]
upgradableVersions :: [Version]
#ifndef mingw32_HOST_OS