aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CmdLine.hs4
-rw-r--r--Command.hs9
-rw-r--r--Command/Map.hs1
-rw-r--r--Messages.hs6
-rw-r--r--Upgrade/V2.hs8
5 files changed, 20 insertions, 8 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 85423e5e8..46b980fbc 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -87,7 +87,9 @@ tryRun' state errnum (a:as) = do
a
case result of
Left err -> do
- Annex.eval state $ showErr err
+ Annex.eval state $ do
+ showEndFail
+ showErr err
tryRun' state (errnum + 1) as
Right (True,state') -> tryRun' state' errnum as
Right (False,state') -> tryRun' state' (errnum + 1) as
diff --git a/Command.hs b/Command.hs
index d36f675d2..c666ddbd2 100644
--- a/Command.hs
+++ b/Command.hs
@@ -96,10 +96,15 @@ prepCommand Command { cmdseek = seek } params = do
doCommand :: CommandStart -> CommandCleanup
doCommand = start
where
- start = stage $ maybe (return True) perform
- perform = stage $ maybe (showEndFail >> return False) cleanup
+ start = stage $ maybe success perform
+ perform = stage $ maybe failure cleanup
cleanup = stage $ \r -> showEndResult r >> return r
stage a b = b >>= a
+ success = return True
+ failure = do
+ showProgress
+ showEndFail
+ return False
notAnnexed :: FilePath -> Annex (Maybe a) -> Annex (Maybe a)
notAnnexed file a = maybe a (const $ return Nothing) =<< Backend.lookupFile file
diff --git a/Command/Map.hs b/Command/Map.hs
index 7bb435ff8..940db54c8 100644
--- a/Command/Map.hs
+++ b/Command/Map.hs
@@ -175,6 +175,7 @@ scan r = do
showEndOk
return r'
Nothing -> do
+ showProgress
showEndFail
return r
diff --git a/Messages.hs b/Messages.hs
index c44e44eea..038e4c0bc 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -43,14 +43,16 @@ showEndOk :: Annex ()
showEndOk = verbose $ liftIO $ putStrLn "ok"
showEndFail :: Annex ()
-showEndFail = verbose $ liftIO $ putStrLn "\nfailed"
+showEndFail = verbose $ liftIO $ putStrLn "failed"
showEndResult :: Bool -> Annex ()
showEndResult True = showEndOk
showEndResult False = showEndFail
showErr :: (Show a) => a -> Annex ()
-showErr e = warning $ "git-annex: " ++ show e
+showErr e = do
+ liftIO $ hFlush stdout
+ liftIO $ hPutStrLn stderr $ "git-annex: " ++ show e
warning :: String -> Annex ()
warning w = do
diff --git a/Upgrade/V2.hs b/Upgrade/V2.hs
index 14e328edb..4824f4bba 100644
--- a/Upgrade/V2.hs
+++ b/Upgrade/V2.hs
@@ -54,11 +54,13 @@ upgrade = do
when e $ do
mapM_ (\(k, f) -> inject f $ logFile k) =<< locationLogs g
mapM_ (\f -> inject f f) =<< logFiles (olddir g)
- liftIO $ do
- Git.run g "rm" [Param "-r", Param "-f", Param "-q", File (olddir g)]
- unless bare $ gitAttributesUnWrite g
saveState
+
+ when e $ liftIO $ do
+ Git.run g "rm" [Param "-r", Param "-f", Param "-q", File (olddir g)]
+ unless bare $ gitAttributesUnWrite g
+
unless bare $ push
return True