ok/jj
1
0
Fork 0
forked from mirrors/jj

lib: make DescendantRebaser-related APIs private.

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.
This commit is contained in:
Ilya Grigoriev 2023-12-22 17:35:56 -08:00
parent 45cd0bf11b
commit 277b81ff6f
2 changed files with 3 additions and 3 deletions

View file

@ -885,7 +885,7 @@ impl MutableRepo {
/// Creates a `DescendantRebaser` to rebase descendants of the recorded
/// rewritten and abandoned commits.
// TODO(ilyagr): Inline this. It's only used in tests.
pub fn create_descendant_rebaser<'settings, 'repo>(
fn create_descendant_rebaser<'settings, 'repo>(
&'repo mut self,
settings: &'settings UserSettings,
) -> DescendantRebaser<'settings, 'repo> {

View file

@ -242,7 +242,7 @@ pub struct RebaseOptions {
}
/// Rebases descendants of a commit onto a new commit (or several).
pub struct DescendantRebaser<'settings, 'repo> {
pub(crate) struct DescendantRebaser<'settings, 'repo> {
settings: &'settings UserSettings,
mut_repo: &'repo mut MutableRepo,
// The commit identified by the key has been replaced by all the ones in the value, typically
@ -521,7 +521,7 @@ impl<'settings, 'repo> DescendantRebaser<'settings, 'repo> {
// TODO: Perhaps change the interface since it's not just about rebasing
// commits.
pub fn rebase_next(&mut self) -> Result<Option<RebasedDescendant>, TreeMergeError> {
fn rebase_next(&mut self) -> Result<Option<RebasedDescendant>, TreeMergeError> {
while let Some(old_commit) = self.to_visit.pop() {
let old_commit_id = old_commit.id().clone();
if let Some(new_parent_ids) = self.parent_mapping.get(&old_commit_id).cloned() {