repo: group MutableRepo::rebase_descendants_* functions together

This commit is contained in:
Benjamin Tan 2024-11-11 01:10:18 +08:00
parent 18faaf72a3
commit d7f929fefb

View file

@ -1274,16 +1274,6 @@ impl MutableRepo {
// TODO(ilyagr): Either document that this also moves bookmarks (rename the
// function and the related functions?) or change things so that this only
// rebases descendants.
pub fn rebase_descendants_with_options(
&mut self,
settings: &UserSettings,
options: RebaseOptions,
) -> BackendResult<usize> {
let num_rebased = self
.rebase_descendants_with_options_return_map(settings, options)?
.len();
Ok(num_rebased)
}
/// This is similar to `rebase_descendants_return_map`, but the return value
/// needs more explaining.
@ -1322,6 +1312,24 @@ impl MutableRepo {
Ok(rebased)
}
pub fn rebase_descendants_return_map(
&mut self,
settings: &UserSettings,
) -> BackendResult<HashMap<CommitId, CommitId>> {
self.rebase_descendants_with_options_return_map(settings, Default::default())
}
pub fn rebase_descendants_with_options(
&mut self,
settings: &UserSettings,
options: RebaseOptions,
) -> BackendResult<usize> {
let num_rebased = self
.rebase_descendants_with_options_return_map(settings, options)?
.len();
Ok(num_rebased)
}
/// Rebase descendants of the rewritten commits.
///
/// The descendants of the commits registered in `self.parent_mappings` will
@ -1363,13 +1371,6 @@ impl MutableRepo {
Ok(num_reparented)
}
pub fn rebase_descendants_return_map(
&mut self,
settings: &UserSettings,
) -> BackendResult<HashMap<CommitId, CommitId>> {
self.rebase_descendants_with_options_return_map(settings, Default::default())
}
pub fn set_wc_commit(
&mut self,
workspace_id: WorkspaceId,