+findChangedPagesAtRevision :: Repository -> RevNum -> IO (Set PageName)
+findChangedPagesAtRevision repos rev
+ = do fs <- getRepositoryFS repos
+ withRevision fs rev
+ $ getPathsChanged >>= return . foldl accumulatePages S.empty . map fst
+ where
+ accumulatePages :: Set PageName -> FilePath -> Set PageName
+ accumulatePages s path
+ | "/pages/" `isPrefixOf` path && ".page" `isSuffixOf` path
+ = let encoded = makeRelative "/pages" $ dropExtension path
+ name = decodePageName encoded
+ in
+ S.insert name s
+ | otherwise
+ = s
+
+