diff --git a/Annex/StandardGroups.hs b/Annex/StandardGroups.hs index e94185fbfa..7c47cc628c 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/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs index 796edc3eeb..e3ba914279 100644 --- a/Assistant/WebApp/Configurators/Local.hs +++ b/Assistant/WebApp/Configurators/Local.hs @@ -30,6 +30,7 @@ import Utility.Network import Remote (prettyListUUIDs) import Annex.UUID import Annex.StandardGroups +import Logs.PreferredContent import Yesod import Data.Text (Text) diff --git a/Assistant/WebApp/Configurators/S3.hs b/Assistant/WebApp/Configurators/S3.hs index 9ae5fbe520..3c6fc5d907 100644 --- a/Assistant/WebApp/Configurators/S3.hs +++ b/Assistant/WebApp/Configurators/S3.hs @@ -22,6 +22,7 @@ import Logs.Remote import qualified Remote import Types.Remote (RemoteConfig) import Annex.StandardGroups +import Logs.PreferredContent import Yesod import Data.Text (Text) diff --git a/Assistant/WebApp/Configurators/Ssh.hs b/Assistant/WebApp/Configurators/Ssh.hs index dafa69f263..d3a281b4b4 100644 --- a/Assistant/WebApp/Configurators/Ssh.hs +++ b/Assistant/WebApp/Configurators/Ssh.hs @@ -19,6 +19,7 @@ import Utility.Yesod import Utility.Rsync (rsyncUrlIsShell) import Logs.Remote import Remote +import Logs.PreferredContent import Annex.StandardGroups import Yesod diff --git a/Logs/PreferredContent.hs b/Logs/PreferredContent.hs index e31aa7baee..ed6dbb43e8 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 0fc4cda17c..c0352bb787 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 Wed, 10 Oct 2012 12:59:25 -0400