about summary refs log tree commit diff
path: root/tools/fixcomments.hs
diff options
context:
space:
mode:
authorVincent Ambo <vincent@spotify.com>2014-03-19T11·17+0100
committerVincent Ambo <vincent@spotify.com>2014-03-19T11·17+0100
commit089f44e8c9d216acf0b2054ef0a214108c6a3c91 (patch)
tree45d909c8430ed99c5d5ee92f5c85dc0055d49cd4 /tools/fixcomments.hs
parentd829f0c70c09ff2e4c8617f45cb4c85ac4a46f2c (diff)
Cleaning up after git move
Diffstat (limited to 'tools/fixcomments.hs')
-rw-r--r--tools/fixcomments.hs21
1 files changed, 0 insertions, 21 deletions
diff --git a/tools/fixcomments.hs b/tools/fixcomments.hs
deleted file mode 100644
index dc89dbdd647f..000000000000
--- a/tools/fixcomments.hs
+++ /dev/null
@@ -1,21 +0,0 @@
-
-fixComments :: AcidState Blog -> IO ()
-fixComments acid = do
-    entriesDE <- query' acid $ LatestEntries DE
-    entriesEN <- query' acid $ LatestEntries EN
-    filterComments entriesDE
-    filterComments entriesEN
-  where
-    (cDate :: UTCTime) = fromJust $ parseTime defaultTimeLocale "%d.%m.%Y %T" "22.04.2012 21:57:35"
-    foldOp :: [(EntryId, [UTCTime])] -> Entry -> [(EntryId, [UTCTime])]
-    foldOp l e = let c = map cdate $ filter (\c1 -> cdate c1 > cDate) $ comments e
-                 in if null c then l
-                              else (entryId e, c) : l
-    pred :: Entry -> Bool
-    pred e = let f eId [] = False
-                 f eId (c:r) = if (cdate c > cDate) then True
-                                                    else f eId r
-             in f (entryId e) (comments e)
-    filterComments entries = mapM_ removeComments $ foldl foldOp [] $ filter pred entries
-    removeComments :: (EntryId, [UTCTime]) -> IO ()
-    removeComments (eId, comments) = mapM_ (\c -> update' acid $ DeleteComment eId c) comments
\ No newline at end of file