-
Notifications
You must be signed in to change notification settings - Fork 374
[API] Abstract over repository roots to simplify the addition of new repository formats #6680
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
base: master
Are you sure you want to change the base?
Conversation
| let target = OpamRepositoryRoot.Dir.backup ~tmp_dir dir in | ||
| OpamRepositoryRoot.Dir.copy ~src:dir ~dst:target; | ||
| fun () -> OpamRepositoryRoot.Dir.copy ~src:target ~dst:dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use Dir here instead of the abstraction OpamRepositoryRoot.t ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is guarded under the else branch of if OpamFilename.exists tar so in this case we know that we're working with directories
src/state/opamUpdate.ml
Outdated
| let safe_read_repo_file = function | ||
| | OpamRepositoryRoot.Dir dir -> | ||
| OpamFile.Repo.safe_read (OpamRepositoryPath.repo dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better have this function is OpamRepositoryState (cf related comment in 6625)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the already existing OpamRepositoryRoot.delayed_read_repo function instead
|
I've pushed some commits that contains some reviews proposals, left some comments. It is a very preliminary review comments, i still have some blind spot (that's why i refer to 6625 comments too). |
283ee7a to
17fd765
Compare
…s called everywhere
17fd765 to
baf0725
Compare
Extracted from #6625
Queued on #6679To be merged at the same time as ocaml-opam/opam-rt#86
As mentioned in #6625, adding abstract types over repository roots allows us to simplify and ensure correctness when adding a new format of repository.
In its current form, this PR also changes a couple of unrelated thing that i failed to change back when extracting from #6625 (removal of some use and logic associated withOpamRepositoryConfig.repo_tarring) so it needs at least a cleanup before it is in a mergable state (on top of being queued on the already substantial #6679)