Skip to content

Commit a45b42b

Browse files
committed
Revert "Remove the identifier keyword since we are forced to use verbose_name if tags should work :/"
This reverts commit 82178a3.
1 parent 82178a3 commit a45b42b

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

readthedocs/doc_builder/director.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ def build(self):
213213
def checkout(self):
214214
"""Checkout Git repo and load build config file."""
215215

216-
log.info("Cloning and fetching.")
217-
self.vcs_repository.update()
218-
219216
identifier = self.data.build_commit or self.data.version.identifier
217+
log.info("Cloning and fetching.", identifier=identifier)
218+
self.vcs_repository.update(identifier=identifier)
219+
220220
log.info("Checking out.", identifier=identifier)
221221
self.vcs_repository.checkout(identifier)
222222

readthedocs/vcs_support/backends/bzr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Backend(BaseVCS):
1616
supports_tags = True
1717
fallback_branch = ''
1818

19-
def update(self):
20-
super().update()
19+
def update(self, identifier=None):
20+
super().update(identifier=identifier)
2121
if self.repo_exists():
2222
return self.up()
2323
return self.clone()

readthedocs/vcs_support/backends/git.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ def _get_clone_url(self):
5555
def set_remote_url(self, url):
5656
return self.run('git', 'remote', 'set-url', 'origin', url)
5757

58-
def update(self):
58+
def update(self, identifier=None):
5959
"""
6060
Clone or update the repository.
6161
6262
:param identifier: This is the optional identifier for git fetch - a branch or tag name.
6363
PR references are generated automatically for certain Git providers.
6464
:return:
6565
"""
66-
super().update()
66+
super().update(identifier=identifier)
6767

6868
if self.use_clone_fetch_checkout_pattern():
6969

@@ -72,11 +72,7 @@ def update(self):
7272
self.clone_ng()
7373
# New behavior: No confusing return value. We are not using return values
7474
# in the callers.
75-
# TODO: We are using self.verbose_name as the identifier. This is not a very
76-
# clear understanding, but it's a continuation of how PR patterns are generating
77-
# remote references already from verbose_name. We need to fix this by providing
78-
# a targeted field on the Build model, for instance "git_reference".
79-
self.fetch_ng(identifier=self.verbose_name)
75+
self.fetch_ng(identifier=identifier)
8076

8177
else:
8278
if self.repo_exists():

readthedocs/vcs_support/backends/hg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class Backend(BaseVCS):
1212
supports_branches = True
1313
fallback_branch = 'default'
1414

15-
def update(self):
16-
super().update()
15+
def update(self, identifier=None):
16+
super().update(identifier=identifier)
1717
if self.repo_exists():
1818
return self.pull()
1919
return self.clone()

readthedocs/vcs_support/backends/svn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def __init__(self, *args, **kwargs):
2626
else:
2727
self.base_url = self.repo_url
2828

29-
def update(self):
30-
super().update()
29+
def update(self, identifier=None):
30+
super().update(identifier=identifier)
3131
if self.repo_exists():
3232
return self.up()
3333
return self.co()

readthedocs/vcs_support/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def make_clean_working_dir(self):
8383
safe_rmtree(self.working_dir, ignore_errors=True)
8484
self.check_working_dir()
8585

86-
def update(self):
86+
def update(self, identifier=None):
8787
"""
8888
Update a local copy of the repository in self.working_dir.
8989

0 commit comments

Comments
 (0)