]> gitweb @ CieloNegro.org - Rakka.git/commitdiff
Bugfix
authorpho <pho@cielonegro.org>
Fri, 31 Oct 2008 10:53:08 +0000 (19:53 +0900)
committerpho <pho@cielonegro.org>
Fri, 31 Oct 2008 10:53:08 +0000 (19:53 +0900)
darcs-hash:20081031105308-62b54-837a472f15efa2d523146e0ac3490c035d1933d6.gz

Rakka/Storage/Repos.hs

index 09bd8f3b40e4f4dce879577a66b60b3c88cf67f3..1c5ef08abca28079845c0802dd34170d1551e624 100644 (file)
@@ -136,23 +136,24 @@ loadPageInRepository repos name rev
          withRevision fs rev'
              $ do exists <- isFile path
                   if exists then
          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
 
                     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
           = 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)
 
                               $ 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 {
                           >>= return . fromJust . parseW3CDateTime . chomp . fromJust
 
                return Entity {
@@ -188,18 +190,19 @@ loadPageInRepository repos name rev
                           , entityUpdateInfo = undefined
                           }
       
                           , 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
 
           = 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
 
                           >>= return . fromJust . parseW3CDateTime . chomp . fromJust
 
-               isLocked <- getRevisionProp "rakka:isLocked"
+               isLocked <- getNodeProp path "rakka:isLocked"
                            >>= return . isJust
 
                return Redirection {
                            >>= return . isJust
 
                return Redirection {