aboutsummaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-07-17 15:15:08 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-07-17 15:15:08 -0400
commit12df7d54f0fce2532b50368251fde6f747d0980d (patch)
tree9b049b0a0d56efa7a66944249d39afe059ba0b95 /Logs
parent535697fb264705c6a7b291e0b4a2caa630f55d6a (diff)
log: Added --all option.
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Location.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Logs/Location.hs b/Logs/Location.hs
index ba2aed1b5..62875985f 100644
--- a/Logs/Location.hs
+++ b/Logs/Location.hs
@@ -19,6 +19,7 @@ module Logs.Location (
logChange,
loggedLocations,
loggedLocationsHistorical,
+ loggedLocationsRef,
isKnownKey,
checkDead,
setDead,
@@ -31,10 +32,12 @@ import qualified Annex.Branch
import Logs
import Logs.Presence
import Annex.UUID
-import Git.Types (RefDate)
+import Annex.CatFile
+import Git.Types (RefDate, Ref)
import qualified Annex
import Data.Time.Clock
+import qualified Data.ByteString.Lazy.Char8 as L
{- Log a change in the presence of a key's value in current repository. -}
logStatus :: Key -> LogStatus -> Annex ()
@@ -61,6 +64,10 @@ loggedLocations = getLoggedLocations currentLogInfo
loggedLocationsHistorical :: RefDate -> Key -> Annex [UUID]
loggedLocationsHistorical = getLoggedLocations . historicalLogInfo
+{- Gets the locations contained in a git ref. -}
+loggedLocationsRef :: Ref -> Annex [UUID]
+loggedLocationsRef ref = map toUUID . getLog . L.unpack <$> catObject ref
+
getLoggedLocations :: (FilePath -> Annex [String]) -> Key -> Annex [UUID]
getLoggedLocations getter key = do
config <- Annex.getGitConfig