Skip to content

Commit cfeb3f5

Browse files
committed
wip
1 parent d986cb7 commit cfeb3f5

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/release_tool/commands/generate.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,24 +172,31 @@ def generate(ctx, version: Optional[str], from_version: Optional[str], repo_path
172172
console.print(f"[dim] • {rel.version} (draft={rel.is_draft})[/dim]")
173173

174174
for release in all_releases:
175-
# Filter by detect_mode
176-
if detect_mode == 'published' and release.is_draft:
177-
continue
178-
179175
try:
180176
v = SemanticVersion.parse(release.version)
181-
# Check for exact final version match
177+
178+
# For RC detection: check ALL releases (ignore detect_mode)
179+
# We need to know what RC numbers exist to avoid duplicates
182180
if (v.major == base_version.major and
183181
v.minor == base_version.minor and
184182
v.patch == base_version.patch and
185-
v.is_final()):
186-
final_exists = True
187-
# Also collect RCs while we're here
183+
v.prerelease and v.prerelease.startswith('rc.')):
184+
matching_rcs.append(v)
185+
if debug:
186+
console.print(f"[dim] Found RC: {v} (draft={release.is_draft})[/dim]")
187+
188+
# For final version check: respect detect_mode
189+
# Only consider published releases if detect_mode='published'
190+
if detect_mode == 'published' and release.is_draft:
191+
continue
192+
193+
# Check for exact final version match
188194
if (v.major == base_version.major and
189195
v.minor == base_version.minor and
190196
v.patch == base_version.patch and
191-
v.prerelease and v.prerelease.startswith('rc.')):
192-
matching_rcs.append(v)
197+
v.is_final()):
198+
final_exists = True
199+
193200
except ValueError:
194201
continue
195202

0 commit comments

Comments
 (0)