Skip to content

Commit 445bc29

Browse files
Notifications: unsupported VCS (#11627)
* Notifications: unsupported VCS Closes #11600 * Update readthedocs/projects/notifications.py Co-authored-by: Eric Holscher <[email protected]> --------- Co-authored-by: Eric Holscher <[email protected]>
1 parent e6e9578 commit 445bc29

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

readthedocs/doc_builder/director.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import structlog
1414
import yaml
1515
from django.conf import settings
16-
from django.utils.translation import gettext_lazy as _
1716

1817
from readthedocs.builds.constants import EXTERNAL
1918
from readthedocs.config.config import CONFIG_FILENAME_REGEX
@@ -78,11 +77,7 @@ def setup_vcs(self):
7877
os.makedirs(self.data.project.doc_path)
7978

8079
if not self.data.project.vcs_class():
81-
raise RepositoryError(
82-
_('Repository type "{repo_type}" unknown').format(
83-
repo_type=self.data.project.repo_type,
84-
),
85-
)
80+
raise RepositoryError(RepositoryError.UNSUPPORTED_VCS)
8681

8782
before_vcs.send(
8883
sender=self.data.version,

readthedocs/projects/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class RepositoryError(BuildUserError):
2525
DUPLICATED_RESERVED_VERSIONS = "project:repository:duplicated-reserved-versions"
2626
FAILED_TO_CHECKOUT = "project:repository:checkout-failed"
2727
GENERIC = "project:repository:generic-error"
28+
UNSUPPORTED_VCS = "project:repository:unsupported-vcs"
2829

2930

3031
class SyncRepositoryLocked(BuildAppError):

readthedocs/projects/notifications.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,19 @@
9494
),
9595
type=ERROR,
9696
),
97+
Message(
98+
id=RepositoryError.UNSUPPORTED_VCS,
99+
header=_("Repository type not suported"),
100+
body=_(
101+
textwrap.dedent(
102+
"""
103+
Subversion, Mercurial, and Bazaar are not supported anymore.
104+
Read more about this deprecation in <a href="https://about.readthedocs.com/blog/2024/02/drop-support-for-subversion-mercurial-bazaar/">our blog</a>.
105+
"""
106+
).strip(),
107+
),
108+
type=ERROR,
109+
),
97110
Message(
98111
id=ProjectConfigurationError.NOT_FOUND,
99112
header=_("Sphinx configuration file is missing"),

0 commit comments

Comments
 (0)