Skip to content

legacy: lazy-import legacy classes inside v1 branches only, refs #9556#9650

Open
mr-raj12 wants to merge 1 commit into
borgbackup:masterfrom
mr-raj12:legacy-package-phase4
Open

legacy: lazy-import legacy classes inside v1 branches only, refs #9556#9650
mr-raj12 wants to merge 1 commit into
borgbackup:masterfrom
mr-raj12:legacy-package-phase4

Conversation

@mr-raj12
Copy link
Copy Markdown
Contributor

@mr-raj12 mr-raj12 commented May 16, 2026

Removes top-level LegacyRepository, LegacyRemoteRepository, and RepoObj1 imports from three files, moving each to the branch that uses it, refs #9556.

  • borg.remote: LegacyRepository imported inside RepositoryServer.open(), guarded by v1_or_v2
  • borg.archiver._common: LegacyRemoteRepository and LegacyRepository imported inside get_repository() under the same guard; RepoObj1 imported inside with_other_repository() under repository.version == 1
  • borg.archiver.transfer_cmd: LegacyRepository imported at the top of transfer_chunks(), where it appears in the except tuple

No logic changes. None of these modules pull in borg.legacy at import time anymore, so a future phase can drop the package without them breaking at startup.

Refs #9556

Checklist

  • PR is against master
  • New code has tests
  • Tests pass
  • Commit message references related issue

@mr-raj12 mr-raj12 force-pushed the legacy-package-phase4 branch from 031a902 to 9fa3b5f Compare May 16, 2026 04:38
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.05%. Comparing base (6659bd9) to head (9fa3b5f).
⚠️ Report is 16 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/borg/archiver/_common.py 61.53% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9650      +/-   ##
==========================================
- Coverage   83.08%   83.05%   -0.04%     
==========================================
  Files          90       90              
  Lines       15653    15659       +6     
  Branches     2356     2359       +3     
==========================================
- Hits        13006    13005       -1     
- Misses       1887     1891       +4     
- Partials      760      763       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant