aboutsummaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-09-09 15:49:44 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-09-09 15:51:34 -0400
commitd1f722e3b0b74a9d9a2e35ac1f47dbca9f7cf606 (patch)
tree74314a3747d4a0456135bf38b2e1115b5a3f64b9 /Messages.hs
parent2408f5c6084aa04a09b36edcd264ce6bc7177c93 (diff)
better locking for json with -J
Avoid threads emitting json at the same time and scrambling, which was still possible even with the buffering, just less likely. Converted json IO actions to JSONChunk data too.
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Messages.hs b/Messages.hs
index 38b8ad890..53f356c1d 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -85,7 +85,7 @@ showSideAction m = Annex.getState Annex.output >>= go
Annex.changeState $ \s -> s { Annex.output = st' }
| sideActionBlock st == InBlock = return ()
| otherwise = p
- p = outputMessage q $ "(" ++ m ++ "...)\n"
+ p = outputMessage JSON.none $ "(" ++ m ++ "...)\n"
showStoringStateAction :: Annex ()
showStoringStateAction = showSideAction "recording state in git"
@@ -110,7 +110,7 @@ doSideAction' b a = do
{- Make way for subsequent output of a command. -}
showOutput :: Annex ()
showOutput = unlessM commandProgressDisabled $
- outputMessage q "\n"
+ outputMessage JSON.none "\n"
showLongNote :: String -> Annex ()
showLongNote s = outputMessage (JSON.note s) ('\n' : indent s ++ "\n")
@@ -140,7 +140,7 @@ earlyWarning = warning' False
warning' :: Bool -> String -> Annex ()
warning' makeway w = do
when makeway $
- outputMessage q "\n"
+ outputMessage JSON.none "\n"
outputError (w ++ "\n")
{- Not concurrent output safe. -}
@@ -173,10 +173,10 @@ showCustom command a = do
outputMessage (JSON.end r) ""
showHeader :: String -> Annex ()
-showHeader h = outputMessage q $ (h ++ ": ")
+showHeader h = outputMessage JSON.none $ (h ++ ": ")
showRaw :: String -> Annex ()
-showRaw s = outputMessage q (s ++ "\n")
+showRaw s = outputMessage JSON.none (s ++ "\n")
setupConsole :: IO ()
setupConsole = do