-
Notifications
You must be signed in to change notification settings - Fork 349
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
Conversation
ebc3d87
to
fdcd7cf
Compare
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'm not super familiar with the current/future rebase API, but the change looks good to me.
…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).
A TODO left over from a previous PR
…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.
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.
Thank you very much for wading through this, Yuya and Martin!
Inline `create_descendant_commits`, move some functionality of `DescendantRebaser::rebase_next` to `rebase_all`, a seemingly more logical location.
fdcd7cf
to
2624f18
Compare
…sumes the rebaser This prevents a clone and does not affect the public API, as suggested in jj-vcs#2738 (comment).
…sumes the rebaser This prevents a clone and does not affect the public API, as suggested in jj-vcs#2738 (comment).
…sumes the rebaser This prevents a clone and does not affect the public API, as suggested in #2738 (comment).
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: