diff --git a/Upgrade.hs b/Upgrade.hs index fed76d838e..457fab180b 100644 --- a/Upgrade.hs +++ b/Upgrade.hs @@ -15,7 +15,6 @@ import qualified Git import Annex.Version import Types.RepoVersion #ifndef mingw32_HOST_OS -{- import qualified Upgrade.V0 import qualified Upgrade.V1 #endif @@ -24,7 +23,6 @@ import qualified Upgrade.V3 import qualified Upgrade.V4 import qualified Upgrade.V5 import qualified Upgrade.V6 --} import qualified Data.Map as M @@ -74,7 +72,6 @@ upgrade automatic destversion = do ) go _ = return True -{- #ifndef mingw32_HOST_OS up (RepoVersion 0) = Upgrade.V0.upgrade up (RepoVersion 1) = Upgrade.V1.upgrade @@ -87,6 +84,4 @@ upgrade automatic destversion = do up (RepoVersion 4) = Upgrade.V4.upgrade automatic up (RepoVersion 5) = Upgrade.V5.upgrade automatic up (RepoVersion 6) = Upgrade.V6.upgrade automatic --} up _ = return True - diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs index 0d41dde2a5..fd46108dd5 100644 --- a/Upgrade/V1.hs +++ b/Upgrade/V1.hs @@ -84,8 +84,8 @@ updateSymlinks :: Annex () updateSymlinks = do showAction "updating symlinks" top <- fromRepo Git.repoPath - (files, cleanup) <- inRepo $ LsFiles.inRepo [top] - forM_ files fixlink + (files, cleanup) <- inRepo $ LsFiles.inRepo [toRawFilePath top] + forM_ files (fixlink . fromRawFilePath) void $ liftIO cleanup where fixlink f = do diff --git a/Upgrade/V2.hs b/Upgrade/V2.hs index ffac8e49aa..9b29783e9d 100644 --- a/Upgrade/V2.hs +++ b/Upgrade/V2.hs @@ -50,7 +50,7 @@ upgrade = do e <- liftIO $ doesDirectoryExist old when e $ do config <- Annex.getGitConfig - mapM_ (\(k, f) -> inject f $ locationLogFile config k) =<< locationLogs + mapM_ (\(k, f) -> inject f $ fromRawFilePath $ locationLogFile config k) =<< locationLogs mapM_ (\f -> inject f f) =<< logFiles old saveState False @@ -76,13 +76,13 @@ locationLogs = do where tryDirContents d = catchDefaultIO [] $ dirContents d islogfile f = maybe Nothing (\k -> Just (k, f)) $ - locationLogFileKey f + locationLogFileKey (toRawFilePath f) inject :: FilePath -> FilePath -> Annex () inject source dest = do old <- fromRepo olddir new <- liftIO (readFile $ old source) - Annex.Branch.change dest $ \prev -> + Annex.Branch.change (toRawFilePath dest) $ \prev -> encodeBL $ unlines $ nub $ lines (decodeBL prev) ++ lines new logFiles :: FilePath -> Annex [FilePath] diff --git a/Upgrade/V5.hs b/Upgrade/V5.hs index 5d331c8787..ba897399f2 100644 --- a/Upgrade/V5.hs +++ b/Upgrade/V5.hs @@ -5,6 +5,8 @@ - Licensed under the GNU AGPL version 3 or higher. -} +{-# LANGUAGE OverloadedStrings #-} + module Upgrade.V5 where import Annex.Common @@ -106,7 +108,7 @@ convertDirect = do upgradeDirectWorkTree :: Annex () upgradeDirectWorkTree = do top <- fromRepo Git.repoPath - (l, clean) <- inRepo $ Git.LsFiles.stagedDetails [top] + (l, clean) <- inRepo $ Git.LsFiles.stagedDetails [toRawFilePath top] forM_ l go void $ liftIO clean where @@ -119,11 +121,11 @@ upgradeDirectWorkTree = do Just k -> do stagePointerFile f Nothing =<< hashPointerFile k ifM (isJust <$> getAnnexLinkTarget f) - ( writepointer f k - , fromdirect f k + ( writepointer (fromRawFilePath f) k + , fromdirect (fromRawFilePath f) k ) Database.Keys.addAssociatedFile k - =<< inRepo (toTopFilePath f) + =<< inRepo (toTopFilePath (fromRawFilePath f)) go _ = noop fromdirect f k = ifM (Direct.goodContent k f)