Skip to content

legacy: support date: archive patterns for --from-borg1 - #9969

Merged
ThomasWaldmann merged 1 commit into
masterfrom
fix-9949-legacy-date
Jul 29, 2026
Merged

legacy: support date: archive patterns for --from-borg1#9969
ThomasWaldmann merged 1 commit into
masterfrom
fix-9949-legacy-date

Conversation

@ThomasWaldmann

Copy link
Copy Markdown
Member

Problem

The date: archive-matching pattern (#8776) works for borg2 repos but not when filtering legacy (borg 1.x) repos via --from-borg1 — e.g. borg2 repo-list --from-borg1 -a 'date:2026-03' returns no matching archives even when matches exist. Reported in #9949.

The pattern is implemented in Archives._matching_info_tuples (manifest.py) but the corresponding LegacyArchives._matching_info_tuples (legacy/archives.py) handles aid:, tags:, user:, host: and name matching only — it silently falls through to name matching for date:, matching nothing.

Fix

Add the same date: branch to LegacyArchives._matching_info_tuples, mirroring the borg2 implementation (compile_date_pattern / DatePatternErrorCommandError). This is especially useful for borg2 transfer --from-borg1.

Tests

Added test_list_match_date and test_list_match_date_invalid_raises to legacy_archives_test.py, alongside the existing user:/host:/tags: match tests.

  • legacy_archives_test.py: 52 passed
  • match_archives_date_test.py (existing date suite): 34 passed, no regression

Fixes #9949

🤖 Generated with Claude Code

The date: archive matching pattern (#8776) was implemented for borg2
repos in manifest.py but not in the legacy code path used by
borg2 repo-list/transfer --from-borg1, so date: patterns matched no
archives when filtering legacy (borg 1.x) repos.

Add the same date: branch to LegacyArchives._matching_info_tuples,
mirroring the borg2 implementation.

Fixes #9949

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ThomasWaldmann
ThomasWaldmann merged commit 1e941c4 into master Jul 29, 2026
18 of 19 checks passed
@ThomasWaldmann
ThomasWaldmann deleted the fix-9949-legacy-date branch July 29, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

borg2 repo-list|transfer --from-borg1: date: patterns match no archives

1 participant