summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-10 15:27:25 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-10 15:27:25 -0400
commit3a9d1edb4ce0c0b1c2b71598ad7000875ad82828 (patch)
tree758134204aa4eb9110dc5c27697ede1fa07c96bc
parent2d1e48b3547b4df855d7166e7cee9fd3c00b8ec5 (diff)
webapp: put new repos in standard groups
I'm using transfer for most things, both removable drives and cloud storage, because it's the safest choice. We'll see if it makes sense to prompt for the group when setting this up, or let the user pick something else after the fact.
-rw-r--r--Annex/StandardGroups.hs (renamed from Annex/Groups.hs)10
-rw-r--r--Logs/PreferredContent.hs2
2 files changed, 10 insertions, 2 deletions
diff --git a/Annex/Groups.hs b/Annex/StandardGroups.hs
index 3b4449514..e94185fbf 100644
--- a/Annex/Groups.hs
+++ b/Annex/StandardGroups.hs
@@ -5,7 +5,12 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-module Annex.Groups where
+module Annex.StandardGroups where
+
+import Common.Annex
+import Logs.Group
+
+import qualified Data.Set as S
data StandardGroup = ClientGroup | TransferGroup | ArchiveGroup | BackupGroup
@@ -28,3 +33,6 @@ 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 8fdfef1fd..e31aa7bae 100644
--- a/Logs/PreferredContent.hs
+++ b/Logs/PreferredContent.hs
@@ -25,10 +25,10 @@ import Logs.UUIDBased
import Limit
import qualified Utility.Matcher
import Annex.UUID
-import Annex.Groups
import Git.FilePath
import Types.Group
import Logs.Group
+import Annex.StandardGroups
{- Filename of preferred-content.log. -}
preferredContentLog :: FilePath