diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-16 15:48:26 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-16 15:48:26 -0400 |
commit | d7ef5fd2941fa66aa7f9c998fe4acfda60e63295 (patch) | |
tree | f31d160f1ce06bf2c8d9cf072acc9c392d93b5cf | |
parent | bc21502b9a640e798dc6bbbb255aa9742a1c6187 (diff) |
add explicit upgrade command
-rw-r--r-- | Command/Upgrade.hs | 22 | ||||
-rw-r--r-- | GitAnnex.hs | 2 | ||||
-rw-r--r-- | Upgrade/V1.hs | 4 | ||||
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | doc/git-annex.mdwn | 6 |
5 files changed, 34 insertions, 3 deletions
diff --git a/Command/Upgrade.hs b/Command/Upgrade.hs new file mode 100644 index 000000000..3c9fa3eeb --- /dev/null +++ b/Command/Upgrade.hs @@ -0,0 +1,22 @@ +{- git-annex command + - + - Copyright 2011 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Command.Upgrade where + +import Command + +command :: [Command] +command = [Command "upgrade" paramNothing seek "upgrade repository layout"] + +seek :: [CommandSeek] +seek = [withNothing start] + +start :: CommandStartNothing +start = do + -- The actual upgrading is handled by just running any command, + -- so nothing extra needs to be done. + return $ Just $ return $ Just $ return True diff --git a/GitAnnex.hs b/GitAnnex.hs index da91f6e74..b9c22bdfb 100644 --- a/GitAnnex.hs +++ b/GitAnnex.hs @@ -41,6 +41,7 @@ import qualified Command.Trust import qualified Command.Untrust import qualified Command.Semitrust import qualified Command.Map +import qualified Command.Upgrade cmds :: [Command] cmds = concat @@ -70,6 +71,7 @@ cmds = concat , Command.Whereis.command , Command.Migrate.command , Command.Map.command + , Command.Upgrade.command ] options :: [Option] diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs index 64ca298eb..f1c3e6143 100644 --- a/Upgrade/V1.hs +++ b/Upgrade/V1.hs @@ -104,7 +104,7 @@ updateSymlinks = do liftIO $ removeFile f liftIO $ createSymbolicLink link f Annex.queue "add" [Param "--"] f - Annex.queueRunAt 1024 + Annex.queueRunAt 10240 moveLocationLogs :: Annex () moveLocationLogs = do @@ -132,7 +132,7 @@ moveLocationLogs = do Annex.queue "add" [Param "--"] dest Annex.queue "add" [Param "--"] f Annex.queue "rm" [Param "--quiet", Param "-f", Param "--"] f - Annex.queueRunAt 1024 + Annex.queueRunAt 10240 oldlog2key :: FilePath -> Maybe (FilePath, Key) oldlog2key l = diff --git a/debian/changelog b/debian/changelog index e9fdceee6..a9b9249c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,8 @@ git-annex (0.20110316) UNRELEASED; urgency=low * New repository format, 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. + necessary changes to git. See <http://git-annex.branchable.com/upgrades/> + for details. * Colons are now avoided in filenames, so bare clones of git repos can be put on USB thumb drives formatted with vFAT or similar filesystems. diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index e559e8cba..ee4019068 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -261,6 +261,12 @@ Many git-annex commands will stage changes for later `git commit` by you. git annex setkey --key=WORM-s3-m1287765018--file /tmp/file +* upgrade + + Upgrades the repository to current layout. Upgrades are done automatically + whenever a newer git annex encounters an old repository; this command + allows explcitly starting an upgrade. + # OPTIONS * --force |