diff options
author | Joey Hess <joey@kitenet.net> | 2011-06-22 14:18:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-06-22 14:18:49 -0400 |
commit | 78a325b09315efd593e6b729de18f15871a0d643 (patch) | |
tree | 22516f01e3fcccde1d1c2ade57315d2ba6e95d64 /Annex.hs | |
parent | 1cca8b4edb963b980e64ed0b7de7814b5380e214 (diff) |
add a small cache of the most recently accessed item from the git-annex branch
This will speed up typical cases like git-annex get, which currently
has to read the location log once, then read it a second time in order to
add a line to it. Since these reads now involve more than just reading
in a file, it seemed good to add a cache layer.
Only the most recent thing needs to be cached, because git-annex has
good locality; it operates on one file at a time, and only cares
about one item from the branch per file.
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -23,6 +23,7 @@ import GitQueue import Types.Backend import Types.Remote import Types.Crypto +import Types.Branch import TrustLevel import Types.UUID @@ -39,7 +40,8 @@ data AnnexState = AnnexState , quiet :: Bool , force :: Bool , fast :: Bool - , updated :: Bool + , branchupdated :: Bool + , branchcache :: BranchCache , forcebackend :: Maybe String , forcenumcopies :: Maybe Int , defaultkey :: Maybe String @@ -60,7 +62,8 @@ newState allbackends gitrepo = AnnexState , quiet = False , force = False , fast = False - , updated = False + , branchupdated = False + , branchcache = emptyBranchCache , forcebackend = Nothing , forcenumcopies = Nothing , defaultkey = Nothing |