Skip to content

legacy: split borg 1.x directory resolution into borg.legacy.fs#9822

Open
mr-raj12 wants to merge 1 commit into
borgbackup:masterfrom
mr-raj12:legacy-fs-extraction
Open

legacy: split borg 1.x directory resolution into borg.legacy.fs#9822
mr-raj12 wants to merge 1 commit into
borgbackup:masterfrom
mr-raj12:legacy-fs-extraction

Conversation

@mr-raj12

Copy link
Copy Markdown
Contributor

Description

helpers.fs used to take a legacy= flag on every directory function to pick between the borg2 layout and the old borg 1.x one. This drops the flag. The borg2 functions keep just the borg2 behaviour, and the borg 1.x home/base, config, cache, keys and security dir logic moves into a new module, borg.legacy.fs.

borg.security is the only production code left that needs the v1 layout. It goes through a small _security_dir(repository) helper that imports legacy.fs lazily, and only when repository.version == 1, so a borg2 repo never touches the legacy package at all.

The dir-resolution tests that used to drive the flag move to testsuite/legacy_fs_test.py, where they check the modern and v1 results agree where they should. Part of #9556.

Checklist

  • PR is against master
  • New code has tests
  • Tests pass (targeted fs/legacy tests pass)
  • Commit messages are clean and reference related issues

helpers.fs keeps only the borg2 layout; the v1 home/config/cache/keys/security
dir logic now lives in legacy.fs. Part of borgbackup#9556.
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.56863% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.87%. Comparing base (106dfba) to head (1ebdf86).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/borg/legacy/fs.py 64.19% 24 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9822      +/-   ##
==========================================
- Coverage   84.94%   84.87%   -0.08%     
==========================================
  Files          92       93       +1     
  Lines       15291    15328      +37     
  Branches     2296     2302       +6     
==========================================
+ Hits        12989    13009      +20     
- Misses       1611     1624      +13     
- Partials      691      695       +4     

☔ View full report in Codecov by Harness.
📢 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