diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-06 12:43:56 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-06 12:43:56 -0400 |
commit | ebb16a8c45f5ec12aff6fd158090d6a36d5590dc (patch) | |
tree | df6630b4844709e8266f330a875857d395c03454 /Annex | |
parent | d6a25390ad9006d3c8eeeefd535703626dd09490 (diff) |
--in can now refer to files that were located in a repository at some past date. For example, --in="here@{yesterday}"
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Branch.hs | 9 |
1 files changed, 8 insertions, 1 deletions
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. - |