summaryrefslogtreecommitdiff
path: root/Upgrade
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-07-19 14:07:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-07-19 14:07:23 -0400
commit00153eed48a2328969cc08688ef674a4c19c2014 (patch)
treef2ee8ac90225d1d2329f45b43061b53b7757d815 /Upgrade
parentec9e9343d9fa99b0786ee93ff142484e2402d3c8 (diff)
unify elipsis handling
And add a simple dots-based progress display, currently only used in v2 upgrade.
Diffstat (limited to 'Upgrade')
-rw-r--r--Upgrade/V0.hs2
-rw-r--r--Upgrade/V1.hs8
-rw-r--r--Upgrade/V2.hs13
3 files changed, 14 insertions, 9 deletions
diff --git a/Upgrade/V0.hs b/Upgrade/V0.hs
index 071fd12ee..3aabe0770 100644
--- a/Upgrade/V0.hs
+++ b/Upgrade/V0.hs
@@ -23,7 +23,7 @@ import qualified Upgrade.V1
upgrade :: Annex Bool
upgrade = do
- showNote "v0 to v1..."
+ showAction "v0 to v1"
g <- Annex.gitRepo
-- do the reorganisation of the key files
diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs
index 8a3d37a64..c41310880 100644
--- a/Upgrade/V1.hs
+++ b/Upgrade/V1.hs
@@ -58,7 +58,7 @@ import qualified Upgrade.V2
upgrade :: Annex Bool
upgrade = do
- showNote "v1 to v2"
+ showAction "v1 to v2"
g <- Annex.gitRepo
if Git.repoIsLocalBare g
@@ -77,7 +77,7 @@ upgrade = do
moveContent :: Annex ()
moveContent = do
- showNote "moving content..."
+ showAction "moving content"
files <- getKeyFilesPresent1
forM_ files move
where
@@ -91,7 +91,7 @@ moveContent = do
updateSymlinks :: Annex ()
updateSymlinks = do
- showNote "updating symlinks..."
+ showAction "updating symlinks"
g <- Annex.gitRepo
files <- liftIO $ LsFiles.inRepo g [Git.workTree g]
forM_ files fixlink
@@ -108,7 +108,7 @@ updateSymlinks = do
moveLocationLogs :: Annex ()
moveLocationLogs = do
- showNote "moving location logs..."
+ showAction "moving location logs"
logkeys <- oldlocationlogs
forM_ logkeys move
where
diff --git a/Upgrade/V2.hs b/Upgrade/V2.hs
index 99c7806d2..0b1d69f8e 100644
--- a/Upgrade/V2.hs
+++ b/Upgrade/V2.hs
@@ -45,21 +45,25 @@ olddir g
-}
upgrade :: Annex Bool
upgrade = do
- showNote "v2 to v3"
+ showAction "v2 to v3"
g <- Annex.gitRepo
let bare = Git.repoIsLocalBare g
Branch.create
+ showProgress
+
e <- liftIO $ doesDirectoryExist (olddir g)
when e $ do
mapM_ (\(k, f) -> inject f $ logFile k) =<< locationLogs g
mapM_ (\f -> inject f f) =<< logFiles (olddir g)
saveState
+ showProgress
when e $ liftIO $ do
Git.run g "rm" [Param "-r", Param "-f", Param "-q", File (olddir g)]
unless bare $ gitAttributesUnWrite g
+ showProgress
unless bare push
@@ -83,6 +87,7 @@ inject source dest = do
new <- liftIO (readFile $ olddir g </> source)
prev <- Branch.get dest
Branch.change dest $ unlines $ nub $ lines prev ++ lines new
+ showProgress
logFiles :: FilePath -> Annex [FilePath]
logFiles dir = return . filter (".log" `isSuffixOf`)
@@ -105,8 +110,8 @@ push = do
-- "git push" will from then on
-- automatically push it
Branch.update -- just in case
- showNote "pushing new git-annex branch to origin"
- showProgress
+ showAction "pushing new git-annex branch to origin"
+ showOutput
g <- Annex.gitRepo
liftIO $ Git.run g "push" [Param "origin", Param Branch.name]
_ -> do
@@ -116,7 +121,7 @@ push = do
showLongNote $
"git-annex branch created\n" ++
"Be sure to push this branch when pushing to remotes.\n"
- showProgress
+ showOutput
{- Old .gitattributes contents, not needed anymore. -}
attrLines :: [String]