summaryrefslogtreecommitdiff
path: root/LocationLog.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-09 22:14:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-09 22:14:13 -0400
commitdcfb24e5b5764c8a7bde0a1410022a903ba3c99b (patch)
treeb43900ebe7cd37def58230b2e539f65e1d37599b /LocationLog.hs
parentc920505a52ab3c42b7892b7f7a1c5244c39e916f (diff)
add logFile
Diffstat (limited to 'LocationLog.hs')
-rw-r--r--LocationLog.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/LocationLog.hs b/LocationLog.hs
index c756a17b0..ab109460a 100644
--- a/LocationLog.hs
+++ b/LocationLog.hs
@@ -19,6 +19,7 @@ module LocationLog where
import Data.DateTime
import System.IO
import System.Posix.IO
+import GitRepo
data LogLine = LogLine {
date :: DateTime,
@@ -79,3 +80,10 @@ logNow :: String -> String -> IO LogLine
logNow repo file = do
now <- getCurrentTime
return $ LogLine now repo file
+
+{- Returns the filename of the log file for a given annexed file. -}
+logFile :: String -> IO String
+logFile annexedFile = do
+ repo <- repoTop
+ return $ repo ++ "/.git-annex/" ++
+ (gitRelative repo annexedFile) ++ ".log"