summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-05 16:52:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-05 16:52:44 -0400
commit715a2ef24e4ca0791c4cc8515fcfcc3c5d593697 (patch)
tree079667eda7390a332d081f5cb30b58e874d921e3 /Annex.hs
parent43c612c76563c765b48999a22956d1f9cf79704a (diff)
add AssumeNotPresent parameter to limits
Solves the issue with preferred content expressions and dropping that I mentioned yesterday. My solution was to add a parameter to specify a set of repositories where content should be assumed not to be present. When deciding whether to drop, it can put the current repository in, and then if the expression fails to match, the content can be dropped. Using yesterday's example "(not copies=trusted:2) and (not in=usbdrive)", when the local repo is one of the 2 trusted copies, the drop check will see only 1 trusted copy, so the expression matches, and so the content will not be dropped.
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Annex.hs b/Annex.hs
index 572823497..a4a56f5ff 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -52,6 +52,7 @@ import Types.UUID
import Utility.State
import qualified Utility.Matcher
import qualified Data.Map as M
+import qualified Data.Set as S
-- git-annex's monad
newtype Annex a = Annex { runAnnex :: StateT AnnexState IO a }
@@ -76,7 +77,7 @@ instance MonadBaseControl IO Annex where
type Matcher a = Either [Utility.Matcher.Token a] (Utility.Matcher.Matcher a)
-type PreferredContentMap = M.Map UUID (Utility.Matcher.Matcher (FilePath -> Annex Bool))
+type PreferredContentMap = M.Map UUID (Utility.Matcher.Matcher (S.Set UUID -> FilePath -> Annex Bool))
-- internal state storage
data AnnexState = AnnexState