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

Refactor MutRepo to make DescendantRebaser private (pt 2) #2738

Merged
merged 6 commits into from
Jan 2, 2024

Conversation

ilyagr
Copy link
Contributor

@ilyagr ilyagr commented Dec 23, 2023

This finishes up #2737, making DescendantRebaser private to the library crate, and removing the use of the newly internal APIs from all the tests.

Checklist

If applicable:

  • I have added tests to cover my changes

@ilyagr ilyagr force-pushed the rm-descreb-api-pt2 branch 18 times, most recently from ebc3d87 to fdcd7cf Compare December 25, 2023 03:26
@ilyagr ilyagr marked this pull request as ready for review December 25, 2023 03:29
Copy link
Contributor

@yuja yuja left a comment

Choose a reason for hiding this comment

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

I'm not super familiar with the current/future rebase API, but the change looks good to me.

lib/src/repo.rs Show resolved Hide resolved
lib/src/rewrite.rs Outdated Show resolved Hide resolved
ilyagr added 5 commits January 1, 2024 18:32
…ed APIs

This removes uses of `DescendantRebaser::new` or
`MutRepo::create_descendant_rebaser` from most tests. The exceptions  are the
tests having to do with abandoning empty commits on rebase, since adjusting
those is a bit more elaborate (see follow-up commits).
…mmits

This commit is a little out of place in this sequence, but
it seems to make more sense for MutRepo to own these maps.

@yuja [pointed out] that any tests written using `create_descendant_rebaser` now
need to do this cleanup, but there are no longer any such tests after the
previous commits and a follow-up commit removes `create_descendant_rebaser`
entirely.

[pointed out]: jj-vcs#2737 (comment)
This completes the process of removing DescendantRebaser-related APIs from
tests. It requires creating some new test utils and a new
`rebase_descendants_with_option_return_map`.
Finally, there are no test uses of these APIs. `DescendantRebaser` is made
`pub(crate)`, since it is used by `MutRepo`. Other functions are made private.
Copy link
Contributor Author

@ilyagr ilyagr left a comment

Choose a reason for hiding this comment

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

Thank you very much for wading through this, Yuya and Martin!

lib/src/repo.rs Show resolved Hide resolved
lib/src/rewrite.rs Outdated Show resolved Hide resolved
Inline `create_descendant_commits`, move some functionality of
`DescendantRebaser::rebase_next` to `rebase_all`, a seemingly more logical
location.
@ilyagr ilyagr force-pushed the rm-descreb-api-pt2 branch from fdcd7cf to 2624f18 Compare January 2, 2024 02:44
@ilyagr ilyagr enabled auto-merge (rebase) January 2, 2024 02:50
ilyagr added a commit to ilyagr/jj that referenced this pull request Jan 2, 2024
…sumes the rebaser

This prevents a clone and does not affect the public API, as suggested
in jj-vcs#2738 (comment).
@ilyagr ilyagr merged commit ddec3f9 into jj-vcs:main Jan 2, 2024
15 checks passed
@ilyagr ilyagr deleted the rm-descreb-api-pt2 branch January 2, 2024 02:52
ilyagr added a commit to ilyagr/jj that referenced this pull request Jan 2, 2024
…sumes the rebaser

This prevents a clone and does not affect the public API, as suggested
in jj-vcs#2738 (comment).
ilyagr added a commit that referenced this pull request Jan 2, 2024
…sumes the rebaser

This prevents a clone and does not affect the public API, as suggested
in #2738 (comment).
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.

3 participants