diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-11 18:39:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-11 18:39:21 -0400 |
commit | ccfda0a1b479f131e69e0158b4269dc98982b268 (patch) | |
tree | f2ade0df2e6b5238615b56037bd01268f7ac7dfd | |
parent | 76090d48b97a2b29da03a2955e90da71d3842e82 (diff) |
git config remote.name.annex-sync can be used to control whether a remote gets synced.
-rw-r--r-- | Command/Sync.hs | 4 | ||||
-rw-r--r-- | Config.hs | 5 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/git-annex.mdwn | 5 |
4 files changed, 15 insertions, 1 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index 11ea30a52..1795a6104 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -26,6 +26,7 @@ import Git.Types (BlobType(..)) import qualified Types.Remote import qualified Remote.Git import Types.Key +import Config import qualified Data.ByteString.Lazy as L import Data.Hash.MD5 @@ -71,7 +72,8 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted ) unwords (map Types.Remote.name s) return l available = filter (not . Remote.specialRemote) - <$> Remote.enabledRemoteList + <$> (filterM (repoSyncable . Types.Remote.repo) + =<< Remote.enabledRemoteList) good = filterM $ Remote.Git.repoAvail . Types.Remote.repo fastest = fromMaybe [] . headMaybe . Remote.byCost @@ -86,6 +86,11 @@ repoNotIgnored :: Git.Repo -> Annex Bool repoNotIgnored r = not . fromMaybe False . Git.Config.isTrue <$> getRemoteConfig r "ignore" "" +{- Checks if a repo should be synced. -} +repoSyncable :: Git.Repo -> Annex Bool +repoSyncable r = fromMaybe True . Git.Config.isTrue + <$> getRemoteConfig r "sync" "" + {- If a value is specified, it is used; otherwise the default is looked up - in git config. forcenumcopies overrides everything. -} getNumCopies :: Maybe Int -> Annex Int diff --git a/debian/changelog b/debian/changelog index 5a8056cf6..65e091753 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ git-annex (3.20121010) UNRELEASED; urgency=low * webapp: Improve wording of intro display. Closes: #689848 * webapp: Repositories can now be configured, to change their description, their group, or even to disable syncing to them. + * git config remote.name.annex-sync can be used to control whether + a remote gets synced. -- Joey Hess <joeyh@debian.org> Wed, 10 Oct 2012 12:59:25 -0400 diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index 2721cd22d..c427cbfe7 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -795,6 +795,11 @@ Here are all the supported configuration settings. Or, it could be used if the network connection between two repositories is too slow to be used normally. +* `remote.<name>.annex-sync` + + If set to `false`, prevents git-annex sync (and the git-annex assistant) + from syncing with this remote. + * `remote.<name>.annexUrl` Can be used to specify a different url than the regular `remote.<name>.url` |