summaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-05-20 00:14:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-05-20 00:14:56 -0400
commit37ef39c9295fd5f036264791e201262b0e641f85 (patch)
treef1e973292c1adf2c1f33b869c71a26a0d1117c49 /Messages.hs
parentebbd24e5ed6bbb41305d8105d7fac355dcf15bbc (diff)
suppress "(Recording state in git)" message when committing change to remote state
This was shown redundantly for a tricky reason -- while it runs inside a doSideAction block that would appear to supress it, the action being run is in a different state monad; for the remote, and so the suppression doesn't work. Always suppressing the message when committing to a local remote is ok do to though -- it mirrors the /dev/nulling of the git annex shell commit output. And it turns out that any time there is a git-annex branch state change to commit on the remote, the local repo has also had a similar change made, and so the message has been shown already.
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Messages.hs b/Messages.hs
index 4330f7c09..96bf3ae4b 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -14,6 +14,7 @@ module Messages (
MeterUpdate,
showSideAction,
doSideAction,
+ doQuietSideAction,
showStoringStateAction,
showOutput,
showLongNote,
@@ -91,12 +92,19 @@ showSideAction m = Annex.getState Annex.output >>= go
showStoringStateAction :: Annex ()
showStoringStateAction = showSideAction "Recording state in git"
+{- Performs an action, supressing showSideAction messages. -}
+doQuietSideAction :: Annex a -> Annex a
+doQuietSideAction = doSideAction' InBlock
+
{- Performs an action, that may call showSideAction multiple times.
- Only the first will be displayed. -}
doSideAction :: Annex a -> Annex a
-doSideAction a = do
+doSideAction = doSideAction' StartBlock
+
+doSideAction' :: SideActionBlock -> Annex a -> Annex a
+doSideAction' b a = do
o <- Annex.getState Annex.output
- set $ o { sideActionBlock = StartBlock }
+ set $ o { sideActionBlock = b }
set o `after` a
where
set o = Annex.changeState $ \s -> s { Annex.output = o }