From: pho Date: Fri, 31 Oct 2008 10:53:08 +0000 (+0900) Subject: Bugfix X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=9a1da61204cdcf932d8260c87c69bd8fa1992533;p=Rakka.git Bugfix darcs-hash:20081031105308-62b54-837a472f15efa2d523146e0ac3490c035d1933d6.gz --- diff --git a/Rakka/Storage/Repos.hs b/Rakka/Storage/Repos.hs index 09bd8f3..1c5ef08 100644 --- a/Rakka/Storage/Repos.hs +++ b/Rakka/Storage/Repos.hs @@ -136,23 +136,24 @@ loadPageInRepository repos name rev withRevision fs rev' $ do exists <- isFile path if exists then - return . Just =<< loadPage' + return . Just =<< loadPage' fs else return Nothing where path :: FilePath path = mkPagePath name - loadPage' :: Rev Page - loadPage' = do mType <- liftM (fmap (read . chomp)) (getNodeProp path "svn:mime-type") - case mType of - Just (MIMEType "application" "x-rakka-redirection" _) - -> loadPageRedirect - _ - -> loadPageEntity - - loadPageEntity :: Rev Page - loadPageEntity + loadPage' :: FileSystem -> Rev Page + loadPage' fs + = do mType <- liftM (fmap (read . chomp)) (getNodeProp path "svn:mime-type") + case mType of + Just (MIMEType "application" "x-rakka-redirection" _) + -> loadPageRedirect fs + _ + -> loadPageEntity fs + + loadPageEntity :: FileSystem -> Rev Page + loadPageEntity fs = do props <- getNodePropList path hist <- getNodeHistory True path content <- getFileContentsLBS path @@ -162,7 +163,8 @@ loadPageInRepository repos name rev $ fromMaybe "text/x-rakka" $ fmap chomp (lookup "svn:mime-type" props) - lastMod <- getRevisionProp "svn:date" + lastMod <- unsafeIOToFS $ + getRevisionProp' fs pageRev "svn:date" >>= return . fromJust . parseW3CDateTime . chomp . fromJust return Entity { @@ -188,18 +190,19 @@ loadPageInRepository repos name rev , entityUpdateInfo = undefined } - loadPageRedirect :: Rev Page - loadPageRedirect + loadPageRedirect :: FileSystem -> Rev Page + loadPageRedirect fs = do hist <- getNodeHistory True path content <- getFileContents path let pageRev = fst $ head hist dest = chomp $ decodeString content - lastMod <- getRevisionProp "svn:date" + lastMod <- unsafeIOToFS $ + getRevisionProp' fs pageRev "svn:date" >>= return . fromJust . parseW3CDateTime . chomp . fromJust - isLocked <- getRevisionProp "rakka:isLocked" + isLocked <- getNodeProp path "rakka:isLocked" >>= return . isJust return Redirection {