summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Annex/StandardGroups.hs8
-rw-r--r--Logs/PreferredContent.hs10
-rw-r--r--debian/changelog2
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