diff options
-rw-r--r-- | Limit.hs | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -94,18 +94,16 @@ matchGlobFile glob = go {- Adds a limit to skip files not believed to be present - in a specfied repository. Optionally on a prior date. -} addIn :: String -> Annex () -addIn = addLimit . limitIn - -limitIn :: MkLimit -limitIn s = Right $ \notpresent -> checkKey $ \key -> - if name == "." - then if null date - then inhere notpresent key - else inuuid notpresent key =<< getUUID - else inuuid notpresent key =<< Remote.nameToUUID name +addIn s = addLimit =<< mk where (name, date) = separate (== '@') s - inuuid notpresent key u + mk + | name == "." = if null date + then use inhere + else use . inuuid =<< getUUID + | otherwise = use . inuuid =<< Remote.nameToUUID name + use a = return $ Right $ \notpresent -> checkKey (a notpresent) + inuuid u notpresent key | null date = do us <- Remote.keyLocations key return $ u `elem` us && u `S.notMember` notpresent |