[API] Abstract over repository roots to simplify the addition of new repository formats - #6680
Conversation
| let safe_read_repo_file = function | ||
| | OpamRepositoryRoot.Dir dir -> | ||
| OpamFile.Repo.safe_read (OpamRepositoryPath.repo dir) |
There was a problem hiding this comment.
better have this function is OpamRepositoryState (cf related comment in 6625)
There was a problem hiding this comment.
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
17fd765 to
baf0725
Compare
76b1706 to
3a80890
Compare
3a80890 to
af4a114
Compare
af4a114 to
2857336
Compare
|
I've update the PR. The last commit is here as a proposal, introduce in the new |
2857336 to
d980844
Compare
| (OpamRepositoryRoot.Dir.Path.repo tmp_mirror_dir) repo_20; | ||
| let dir20 = | ||
| OpamRepositoryRoot.Dir.of_dir | ||
| OpamRepositoryRoot.Dir.Op.(repo_root / upgradeto_version_string) |
There was a problem hiding this comment.
this change seems like a separate fix rather than a change related to OpamRepositoryRoot
There was a problem hiding this comment.
true, and it is erroneous, the good fix would be :
| OpamRepositoryRoot.Dir.Op.(repo_root / upgradeto_version_string) | |
| OpamRepositoryRoot.Dir.Op.(OpamRepositoryRoot.Dir.basename repo_root / upgradeto_version_string) |
Should we extract it in another PR or have it in a separate commit in this PR ?
There was a problem hiding this comment.
oh, i just saw that it was already in a separate commit.
There was a problem hiding this comment.
erroneous? I don't think so, the code as it was there was fine. basename repo_root would result in a totally different behaviour and bring a potential bug
481a6a2 to
3793831
Compare
…tory formats Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com>
…tors Co-authored-by: Kate <kit-ty-kate@exn.st>
3793831 to
1a2a0e7
Compare
Apply API change from ocaml/opam#6680 : add OpamRepositoryRoot abstraction
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)