Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose some internal constructors #4189

Merged
merged 2 commits into from
Jul 31, 2024
Merged

Expose some internal constructors #4189

merged 2 commits into from
Jul 31, 2024

Conversation

torquestomp
Copy link
Contributor

Many places in jj_cli assume a working std::fs for interrogating repo storage types before loading the repos. Rather than abstract all of that away and introduce complexity, let's expose a couple simple constructor methods to allow a determined client to bypass std::fs interactions in environments that don't support them (for instance, when the repo is stored in a cloud filesystem that isn't mounted locally).

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

Copy link
Contributor

@PhilipMetzger PhilipMetzger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lib/src/repo.rs Show resolved Hide resolved
This enables the creation of Repo objects in environments without standard filesystem support, by allowing the caller to load the store objects however they see fit. This confines interaction with the filesystem to the WorkingCopy abstractions.
This allows constructing a workspace in a custom environment where the standard filesystem API cannot be used
@torquestomp torquestomp enabled auto-merge (rebase) July 31, 2024 23:37
@torquestomp torquestomp merged commit bfa1ce8 into main Jul 31, 2024
29 checks passed
@torquestomp torquestomp deleted the dploch/repo_loader branch July 31, 2024 23:45
torquestomp added a commit that referenced this pull request Aug 30, 2024
Like #4189, this allows extensions the ability to load the repo in an environment where the local filesystem is not accessible. This change allows such extensions to exist at the CLI layer where jj is invoked as a subprocess, rather than a library.
torquestomp added a commit that referenced this pull request Aug 30, 2024
Like #4189, this allows extensions the ability to load the repo in an environment where the local filesystem is not accessible. This change allows such extensions to exist at the CLI layer where jj is invoked as a subprocess, rather than a library (common in testing).
torquestomp added a commit that referenced this pull request Aug 30, 2024
Like #4189, this allows extensions the ability to load the repo in an environment where the local filesystem is not accessible. This change allows such extensions to exist at the CLI layer where jj is invoked as a subprocess, rather than a library (common in testing).
torquestomp added a commit that referenced this pull request Aug 30, 2024
Like #4189, this allows extensions the ability to load the repo in an environment where the local filesystem is not accessible. This change allows such extensions to exist at the CLI layer where jj is invoked as a subprocess, rather than a library (common in testing).
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.

2 participants