summaryrefslogtreecommitdiff
path: root/Version.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-19 14:33:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-19 14:33:24 -0400
commit828a84ba3341d4b7a84292d8b9002a8095dd2382 (patch)
treed1c854a9c3d48bd7256a7c5e1db8dfae75d81f68 /Version.hs
parent33cb114be5135ce02671d8ce80440d40e97ca824 (diff)
Add version command to show git-annex version as well as repository version information.
Diffstat (limited to 'Version.hs')
-rw-r--r--Version.hs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Version.hs b/Version.hs
index 5f414e93b..d4a58d77a 100644
--- a/Version.hs
+++ b/Version.hs
@@ -15,13 +15,18 @@ import qualified Annex
import qualified GitRepo as Git
import Locations
-currentVersion :: String
-currentVersion = "2"
+type Version = String
+
+defaultVersion :: Version
+defaultVersion = "2"
+
+supportedVersions :: [Version]
+supportedVersions = [defaultVersion]
versionField :: String
versionField = "annex.version"
-getVersion :: Annex String
+getVersion :: Annex Version
getVersion = do
g <- Annex.gitRepo
let v = Git.configGet g versionField ""
@@ -42,7 +47,7 @@ getVersion = do
(True, True) -> return "1"
_ -> do
setVersion
- return currentVersion
+ return defaultVersion
setVersion :: Annex ()
-setVersion = Annex.setConfig versionField currentVersion
+setVersion = Annex.setConfig versionField defaultVersion