diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-10 15:35:10 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-10 15:35:10 -0400 |
commit | da68a5b0942327096adfd63378c47c823e873178 (patch) | |
tree | 2952192f6d27ac6836a71a4c52181851a63fc46c | |
parent | 3a9d1edb4ce0c0b1c2b71598ad7000875ad82828 (diff) |
webapp: configure new repos to use the standard preferred content settings
-rw-r--r-- | Annex/StandardGroups.hs | 8 | ||||
-rw-r--r-- | Logs/PreferredContent.hs | 10 | ||||
-rw-r--r-- | debian/changelog | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/Annex/StandardGroups.hs b/Annex/StandardGroups.hs index e94185fbf..7c47cc628 100644 --- a/Annex/StandardGroups.hs +++ b/Annex/StandardGroups.hs @@ -7,11 +7,6 @@ module Annex.StandardGroups where -import Common.Annex -import Logs.Group - -import qualified Data.Set as S - data StandardGroup = ClientGroup | TransferGroup | ArchiveGroup | BackupGroup fromStandardGroup :: StandardGroup -> String @@ -33,6 +28,3 @@ preferredContent ClientGroup = "exclude=*/archive/*" preferredContent TransferGroup = "not inallgroup=client and " ++ preferredContent ClientGroup preferredContent ArchiveGroup = "not copies=archive:1" preferredContent BackupGroup = "" -- all content is preferred - -setStandardGroup :: UUID -> StandardGroup -> Annex () -setStandardGroup u = groupSet u . S.singleton . fromStandardGroup diff --git a/Logs/PreferredContent.hs b/Logs/PreferredContent.hs index e31aa7bae..ed6dbb43e 100644 --- a/Logs/PreferredContent.hs +++ b/Logs/PreferredContent.hs @@ -11,6 +11,7 @@ module Logs.PreferredContent ( preferredContentMap, preferredContentMapRaw, checkPreferredContentExpression, + setStandardGroup, ) where import qualified Data.Map as M @@ -131,3 +132,12 @@ tokenizeMatcher :: String -> [String] tokenizeMatcher = filter (not . null ) . concatMap splitparens . words where splitparens = segmentDelim (`elem` "()") + +{- Puts a UUID in a standard group, and sets its preferred content to use + - the standard expression for that group, unless something is already set. -} +setStandardGroup :: UUID -> StandardGroup -> Annex () +setStandardGroup u g = do + groupSet u $ S.singleton $ fromStandardGroup g + m <- preferredContentMap + unless (isJust $ M.lookup u m) $ + preferredContentSet u "standard" diff --git a/debian/changelog b/debian/changelog index 0fc4cda17..c0352bb78 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ git-annex (3.20121010) UNRELEASED; urgency=low * Renamed --ingroup to --inallgroup. + * Standard groups changed to client, transfer, archive, and backup. + Each of these has its own standard preferred content setting. -- Joey Hess <joeyh@debian.org> Wed, 10 Oct 2012 12:59:25 -0400 |