diff --git a/common b/common index de82e11348f..4ffe08aa698 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit de82e11348fe9e9481b7432de7d2ab0d60531bb0 +Subproject commit 4ffe08aa698e9cc8c6190bc23f5f7c5ded082201 diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 582234a684e..8a157432c78 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1512,6 +1512,8 @@ def add_features(sender, **kwargs): UPDATE_CONDA_STARTUP = 'update_conda_startup' CONDA_APPEND_CORE_REQUIREMENTS = 'conda_append_core_requirements' ALL_VERSIONS_IN_HTML_CONTEXT = 'all_versions_in_html_context' + SKIP_SYNC_TAGS = 'skip_sync_tags' + SKIP_SYNC_BRANCHES = 'skip_sync_branches' SKIP_SYNC = 'skip_sync' FEATURES = ( @@ -1572,7 +1574,16 @@ def add_features(sender, **kwargs): ), ), ( - SKIP_SYNC, _('Skip symlinking and file syncing to webs'), + SKIP_SYNC_TAGS, + _('Skip syncing tags'), + ), + ( + SKIP_SYNC_BRANCHES, + _('Skip syncing branches'), + ), + ( + SKIP_SYNC, + _('Skip symlinking and file syncing to webs'), ), ) diff --git a/readthedocs/projects/tasks.py b/readthedocs/projects/tasks.py index 2c48d147c48..3a51e1d20cb 100644 --- a/readthedocs/projects/tasks.py +++ b/readthedocs/projects/tasks.py @@ -159,13 +159,19 @@ def sync_versions(self, version_repo): """ version_post_data = {'repo': version_repo.repo_url} - if version_repo.supports_tags: + if all([ + version_repo.supports_tags, + not self.project.has_feature(Feature.SKIP_SYNC_TAGS) + ]): version_post_data['tags'] = [{ 'identifier': v.identifier, 'verbose_name': v.verbose_name, } for v in version_repo.tags] - if version_repo.supports_branches: + if all([ + version_repo.supports_branches, + not self.project.has_feature(Feature.SKIP_SYNC_BRANCHES) + ]): version_post_data['branches'] = [{ 'identifier': v.identifier, 'verbose_name': v.verbose_name,