diff --git a/docs/conf.py b/docs/conf.py index c4f2cac64..9de6baf31 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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)) @@ -369,13 +369,16 @@ 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 ) ) @@ -383,7 +386,7 @@ def configure_doxyfile( # 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") @@ -392,13 +395,16 @@ 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 ) ) @@ -406,7 +412,7 @@ def configure_doxyfile( # 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)