summaryrefslogtreecommitdiff
path: root/LocationLog.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-10 15:04:18 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-10 15:04:18 -0400
commitcc235192353561a374c431485c6c3834659e0fa6 (patch)
tree6c092eece822fea609a05acb92850669223c6508 /LocationLog.hs
parentf4d2a05e86df464790fb183148717e7ac7f49cda (diff)
update
Diffstat (limited to 'LocationLog.hs')
-rw-r--r--LocationLog.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/LocationLog.hs b/LocationLog.hs
index f9421cd9a..32af82461 100644
--- a/LocationLog.hs
+++ b/LocationLog.hs
@@ -84,6 +84,7 @@ appendLog file line = do
createDirectoryIfMissing True (parentDir file)
withFileLocked file AppendMode $ \h ->
hPutStrLn h $ show line
+ -- TODO git add log
{- Writes a set of lines to a log file -}
writeLog :: FilePath -> [LogLine] -> IO ()
@@ -99,17 +100,16 @@ logNow status repo = do
return $ LogLine now status repo
{- Returns the filename of the log file for a given annexed file. -}
-logFile :: FilePath -> IO String
-logFile annexedFile = do
- repo <- repoTop
+logFile :: GitRepo -> FilePath -> IO String
+logFile repo annexedFile = do
return $ (gitStateDir repo) ++
(gitRelative repo annexedFile) ++ ".log"
{- Returns a list of repositories that, according to the log, have
- the content of a file -}
-fileLocations :: FilePath -> IO [String]
-fileLocations file = do
- log <- logFile file
+fileLocations :: GitRepo -> FilePath -> IO [String]
+fileLocations thisrepo file = do
+ log <- logFile thisrepo file
lines <- readLog log
return $ map repo (filterPresent lines)