upgrades seem to fully work

This commit is contained in:
Joey Hess 2011-03-16 10:56:59 -04:00
parent 137257ded1
commit a080799900
2 changed files with 39 additions and 4 deletions

View file

@ -14,9 +14,10 @@ import Control.Monad (filterM, forM_, unless)
import System.Posix.Files import System.Posix.Files
import System.FilePath import System.FilePath
import Data.String.Utils import Data.String.Utils
import Key
import System.Posix.Types import System.Posix.Types
import Data.Maybe
import Key
import Content import Content
import Types import Types
import Locations import Locations
@ -94,7 +95,36 @@ updateSymlinks = do
moveLocationLogs :: Annex () moveLocationLogs :: Annex ()
moveLocationLogs = do moveLocationLogs = do
warning "TODO location log move" logkeys <- oldlocationlogs
forM_ logkeys move
where
oldlocationlogs = do
g <- Annex.gitRepo
let dir = gitStateDir g
contents <- liftIO $ getDirectoryContents dir
return $ catMaybes $ map oldlog2key contents
move (l, k) = do
g <- Annex.gitRepo
let dest = logFile g k
let dir = gitStateDir g
let f = dir </> l
liftIO $ createDirectoryIfMissing True (parentDir dest)
-- could just git mv, but this way deals with
-- log files that are not checked into git
liftIO $ copyFile f dest
Annex.queue "add" [Param "--"] dest
Annex.queue "add" [Param "--"] f
Annex.queue "rm" [Param "--quiet", Param "-f", Param "--"] f
oldlog2key :: FilePath -> Maybe (FilePath, Key)
oldlog2key l =
let len = length l - 4 in
if drop len l == ".log"
then let k = readKey1 (take len l) in
if null (keyName k) || null (keyBackendName k)
then Nothing
else Just (l, k)
else Nothing
-- WORM backend keys: "WORM:mtime:size:filename" -- WORM backend keys: "WORM:mtime:size:filename"
-- all the rest: "backend:key" -- all the rest: "backend:key"

9
debian/changelog vendored
View file

@ -1,7 +1,12 @@
git-annex (0.20110316) UNRELEASED; urgency=low git-annex (0.20110316) UNRELEASED; urgency=low
* TODO: upgrade v1 -> v2 * Reorganized .git/annex/objects and .git-annex/; annex.version=2
* Reorganized annexed object store. annex.version=2 * The first time git-annex is run in an old format repository, it
will automatically upgrade it to the new format, staging all
necessary changes to git.
* Note that remotes must be running this version of git-annex,
and must also have been upgraded, in order for git-annex to
communicate with them.
* Colons are now avoided in filenames, so bare clones of git repos * Colons are now avoided in filenames, so bare clones of git repos
can be put on USB thumb drives formatted with vFAT or similar can be put on USB thumb drives formatted with vFAT or similar
filesystems. filesystems.