+-- -*- coding: utf-8 -*-
module Rakka.Storage.Repos
( findAllPagesInRevision
, getDirContentsInRevision
import Data.Set (Set)
import qualified Data.Set as S hiding (Set)
import Data.Time
+import qualified Data.Time.W3C as W3C
import Network.HTTP.Lucu hiding (redirect)
import Rakka.Attachment
import Rakka.Page
import Rakka.SystemConfig
import Rakka.Utils
-import Rakka.W3CDateTime
import Subversion.FileSystem
import Subversion.FileSystem.DirEntry
import Subversion.FileSystem.Revision
$ fmap chomp (lookup "svn:mime-type" props)
lastMod <- unsafeIOToFS $
- liftM (fromJust . parseW3CDateTime . chomp . fromJust)
+ liftM (fromJust . W3C.parse . chomp . fromJust)
(getRevisionProp' fs pageRev "svn:date")
return Entity {
dest = chomp $ decodeString content
lastMod <- unsafeIOToFS $
- liftM (fromJust . parseW3CDateTime . chomp . fromJust)
+ liftM (fromJust . W3C.parse . chomp . fromJust)
(getRevisionProp' fs pageRev "svn:date")
isLocked <- liftM isJust (getNodeProp path "rakka:isLocked")
else
return NotFound
when (status == NoContent)
- $ do doReposTxn repos
+ $ ( (doReposTxn repos
rev
"[Rakka]"
(Just "Automatic commit by Rakka for page deleting")
attachmentExists <- isDirectory attachmentPath
when attachmentExists
$ do deleteEntry attachmentPath
- deleteEmptyParentDirectories attachmentPath
- return ()
+ deleteEmptyParentDirectories attachmentPath)
+ >> return () )
return status
unless exists
$ do createParentDirectories path
makeFile path
- applyText path Nothing (serializeToString attachment)
+ applyText path Nothing (encodeString $ serializeToString attachment)
case ret of
Left _ -> return Conflict
Right _ -> return NoContent