Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ def configure_doxyfile(

# Resolve GitHub link branches: env var → current docs branch → default.
# Computed here so they are available both in the ReadTheDocs clone block and in extlinks.
fastdds_fallback_branch = resolve_fallback_branch("FASTDDS_BRANCH", docs_branch, "master")
fastdds_docs_fallback_branch = resolve_fallback_branch("FASTDDS_DOCS_BRANCH", docs_branch, "master")
fastdds_python_fallback_branch = resolve_fallback_branch("FASTDDS_PYTHON_BRANCH", docs_branch, "master")
fastdds_gen_fallback_branch = resolve_fallback_branch("FASTDDS_GEN_BRANCH", docs_branch, "master")
fastdds_fallback_branch = resolve_fallback_branch("FASTDDS_BRANCH", docs_branch, "3.2.x")
fastdds_docs_fallback_branch = resolve_fallback_branch("FASTDDS_DOCS_BRANCH", docs_branch, "3.2.x")
fastdds_python_fallback_branch = resolve_fallback_branch("FASTDDS_PYTHON_BRANCH", docs_branch, "2.2.x")
fastdds_gen_fallback_branch = resolve_fallback_branch("FASTDDS_GEN_BRANCH", docs_branch, "4.0.x")

print("Fallback branches for GitHub links:")
print(' Fast-DDS: "{}"'.format(fastdds_fallback_branch))
Expand Down Expand Up @@ -369,21 +369,24 @@ def configure_doxyfile(
fastdds_repo_name,
)

# Verify the desired branch actually exists in the cloned remote, falling back to master if not.
# Verify the desired branch/tag actually exists in the cloned remote, falling back to master if not.
fastdds_branch = fastdds_fallback_branch
if fastdds.refs.__contains__("origin/{}".format(fastdds_branch)):
fastdds_branch = "origin/{}".format(fastdds_branch)
elif fastdds.tags.__contains__(fastdds_branch):
# GitPython exposes tags by bare name, e.g. "v3.6.2".
pass
else:
print(
'Fast DDS does not have branch "{}"; falling back to master'.format(
'Fast DDS does not have branch or tag "{}"; falling back to master'.format(
fastdds_branch
)
)
fastdds_branch = "origin/3.2.x"

# Actual checkout
print('Checking out Fast DDS branch "{}"'.format(fastdds_branch))
fastdds.refs[fastdds_branch].checkout()
fastdds.git.checkout(fastdds_branch)

# - Fast DDS Python Bindings
print("Cloning Fast DDS Python Bindings")
Expand All @@ -392,21 +395,24 @@ def configure_doxyfile(
fastdds_python_repo_name,
)

# Verify the desired branch actually exists in the cloned remote, falling back to master if not.
# Verify the desired branch/tag actually exists in the cloned remote, falling back to master if not.
fastdds_python_branch = fastdds_python_fallback_branch
if fastdds_python.refs.__contains__("origin/{}".format(fastdds_python_branch)):
fastdds_python_branch = "origin/{}".format(fastdds_python_branch)
elif fastdds_python.tags.__contains__(fastdds_python_branch):
# GitPython exposes tags by bare name, e.g. "v3.6.1".
pass
else:
print(
'Fast DDS Python does not have branch "{}"; falling back to master'.format(
'Fast DDS Python does not have branch or tag "{}"; falling back to master'.format(
fastdds_python_branch
)
)
fastdds_python_branch = "origin/2.2.x"

# Actual checkout
print('Checking out Fast DDS Python branch "{}"'.format(fastdds_python_branch))
fastdds_python.refs[fastdds_python_branch].checkout()
fastdds_python.git.checkout(fastdds_python_branch)

os.makedirs(os.path.dirname(output_dir), exist_ok=True)
os.makedirs(os.path.dirname(doxygen_html), exist_ok=True)
Expand Down
Loading