display "Recording state in git..." when staging the journal

A bit tricky to avoid printing it twice in a row when there are queued git
commands to run and journal to stage.

Added a generic way to run an action that may output multiple side
messages, with only the first displayed.
This commit is contained in:
Joey Hess 2012-04-27 13:23:52 -04:00
parent e0b7012ccc
commit 76102c1c75
8 changed files with 72 additions and 27 deletions

View file

@ -10,7 +10,6 @@
module Annex (
Annex,
AnnexState(..),
OutputType(..),
new,
newState,
run,
@ -44,6 +43,7 @@ import qualified Types.Remote
import Types.Crypto
import Types.BranchState
import Types.TrustLevel
import Types.Messages
import Utility.State
import qualified Utility.Matcher
import qualified Data.Map as M
@ -69,8 +69,6 @@ instance MonadBaseControl IO Annex where
where
unStAnnex (StAnnex st) = st
data OutputType = NormalOutput | QuietOutput | JSONOutput
type Matcher a = Either [Utility.Matcher.Token a] (Utility.Matcher.Matcher a)
-- internal state storage
@ -78,7 +76,7 @@ data AnnexState = AnnexState
{ repo :: Git.Repo
, backends :: [BackendA Annex]
, remotes :: [Types.Remote.RemoteA Annex]
, output :: OutputType
, output :: MessageState
, force :: Bool
, fast :: Bool
, auto :: Bool
@ -104,7 +102,7 @@ newState gitrepo = AnnexState
{ repo = gitrepo
, backends = []
, remotes = []
, output = NormalOutput
, output = defaultMessageState
, force = False
, fast = False
, auto = False