Skip to content

Commit

Permalink
repo: group MutableRepo::rebase_descendants_* functions together
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnt4n committed Nov 11, 2024
1 parent 18faaf7 commit d7f929f
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions lib/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d7f929f

Please sign in to comment.