optimise for case where there are no required contents
Avoid reading location log in this case.
This commit is contained in:
parent
74c1a5c24b
commit
42ba888875
1 changed files with 15 additions and 12 deletions
|
@ -295,21 +295,24 @@ verifyLocationLog' key ai present u updatestatus = do
|
||||||
- checking against the location log. -}
|
- checking against the location log. -}
|
||||||
verifyRequiredContent :: Key -> ActionItem -> Annex Bool
|
verifyRequiredContent :: Key -> ActionItem -> Annex Bool
|
||||||
verifyRequiredContent key ai@(ActionItemAssociatedFile afile) = do
|
verifyRequiredContent key ai@(ActionItemAssociatedFile afile) = do
|
||||||
presentlocs <- S.fromList <$> loggedLocations key
|
|
||||||
requiredlocs <- S.fromList . M.keys <$> requiredContentMap
|
requiredlocs <- S.fromList . M.keys <$> requiredContentMap
|
||||||
missinglocs <- filterM
|
if S.null requiredlocs
|
||||||
(\u -> isRequiredContent (Just u) S.empty (Just key) afile False)
|
|
||||||
(S.toList $ S.difference requiredlocs presentlocs)
|
|
||||||
if null missinglocs
|
|
||||||
then return True
|
then return True
|
||||||
else do
|
else do
|
||||||
missingrequired <- Remote.prettyPrintUUIDs "missingrequired" missinglocs
|
presentlocs <- S.fromList <$> loggedLocations key
|
||||||
warning $
|
missinglocs <- filterM
|
||||||
"** Required content " ++
|
(\u -> isRequiredContent (Just u) S.empty (Just key) afile False)
|
||||||
actionItemDesc ai key ++
|
(S.toList $ S.difference requiredlocs presentlocs)
|
||||||
" is missing from these repositories:\n" ++
|
if null missinglocs
|
||||||
missingrequired
|
then return True
|
||||||
return False
|
else do
|
||||||
|
missingrequired <- Remote.prettyPrintUUIDs "missingrequired" missinglocs
|
||||||
|
warning $
|
||||||
|
"** Required content " ++
|
||||||
|
actionItemDesc ai key ++
|
||||||
|
" is missing from these repositories:\n" ++
|
||||||
|
missingrequired
|
||||||
|
return False
|
||||||
verifyRequiredContent _ _ = return True
|
verifyRequiredContent _ _ = return True
|
||||||
|
|
||||||
{- Verifies the associated file records. -}
|
{- Verifies the associated file records. -}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue