nub transitionList to avoid ugly message after repeated transitions, and avoid redundant work for repeated ForgetDeadRemotes transitions

This commit is contained in:
Joey Hess 2016-05-18 12:26:38 -04:00
parent 766728c8cf
commit 823c28d2dc
Failed to extract signature
2 changed files with 4 additions and 3 deletions

View file

@ -522,7 +522,7 @@ performTransitionsLocked jl ts neednewlocalbranch transitionedrefs = do
Annex.Queue.flush Annex.Queue.flush
withIndex $ do withIndex $ do
prepareModifyIndex jl prepareModifyIndex jl
run $ mapMaybe getTransitionCalculator $ transitionList ts run $ mapMaybe getTransitionCalculator tlist
Annex.Queue.flush Annex.Queue.flush
if neednewlocalbranch if neednewlocalbranch
then do then do
@ -535,7 +535,8 @@ performTransitionsLocked jl ts neednewlocalbranch transitionedrefs = do
message message
| neednewlocalbranch && null transitionedrefs = "new branch for transition " ++ tdesc | neednewlocalbranch && null transitionedrefs = "new branch for transition " ++ tdesc
| otherwise = "continuing transition " ++ tdesc | otherwise = "continuing transition " ++ tdesc
tdesc = show $ map describeTransition $ transitionList ts tdesc = show $ map describeTransition tlist
tlist = transitionList ts
{- The changes to make to the branch are calculated and applied to {- The changes to make to the branch are calculated and applied to
- the branch directly, rather than going through the journal, - the branch directly, rather than going through the journal,

View file

@ -77,7 +77,7 @@ combineTransitions :: [Transitions] -> Transitions
combineTransitions = S.unions combineTransitions = S.unions
transitionList :: Transitions -> [Transition] transitionList :: Transitions -> [Transition]
transitionList = map transition . S.elems transitionList = nub . map transition . S.elems
{- Typically ran with Annex.Branch.change, but we can't import Annex.Branch {- Typically ran with Annex.Branch.change, but we can't import Annex.Branch
- here since it depends on this module. -} - here since it depends on this module. -}