From ebb16a8c45f5ec12aff6fd158090d6a36d5590dc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Feb 2014 12:43:56 -0400 Subject: --in can now refer to files that were located in a repository at some past date. For example, --in="here@{yesterday}" --- Annex/Branch.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Annex') diff --git a/Annex/Branch.hs b/Annex/Branch.hs index 391e82ae6..ee3cd71e2 100644 --- a/Annex/Branch.hs +++ b/Annex/Branch.hs @@ -18,6 +18,7 @@ module Annex.Branch ( forceUpdate, updateTo, get, + getHistorical, change, commit, forceCommit, @@ -197,7 +198,13 @@ getLocal file = go =<< getJournalFileStale file go Nothing = getRaw file getRaw :: FilePath -> Annex String -getRaw file = withIndex $ L.unpack <$> catFile fullname file +getRaw = getRef fullname + +getHistorical :: RefDate -> FilePath -> Annex String +getHistorical date = getRef (Git.Ref.dateRef fullname date) + +getRef :: Ref -> FilePath -> Annex String +getRef ref file = withIndex $ L.unpack <$> catFile ref file {- Applies a function to modifiy the content of a file. - -- cgit v1.2.3