summaryrefslogtreecommitdiff
path: root/Upgrade/V4.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-05 16:42:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-05 17:05:03 -0400
commit4f6c8222072ace33e3acedddd31637089ae474b6 (patch)
tree720d851820dd6ccc51e5393f2dc87818141ec2ed /Upgrade/V4.hs
parentda9eea5dc0e86b4abb14064346eddc5689d94333 (diff)
v5 for direct mode, with automatic upgrade
This includes storing the current state of the HEAD ref, which git annex sync is going to need, but does not make sync use it.
Diffstat (limited to 'Upgrade/V4.hs')
-rw-r--r--Upgrade/V4.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Upgrade/V4.hs b/Upgrade/V4.hs
new file mode 100644
index 000000000..147ace559
--- /dev/null
+++ b/Upgrade/V4.hs
@@ -0,0 +1,23 @@
+{- git-annex v4 -> v5 uppgrade support
+ -
+ - Copyright 2013 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Upgrade.V4 where
+
+import Common.Annex
+import Config
+import Annex.Direct
+
+{- Direct mode only upgrade. -}
+upgrade :: Bool -> Annex Bool
+upgrade automatic = ifM isDirect
+ ( do
+ unless automatic $
+ showAction "v4 to v5"
+ setDirect True
+ return True
+ , return False
+ )