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

absorb: move core functionality from cli to lib #5127

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cli/src/command_error.rs
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ use std::str;
use std::sync::Arc;

use itertools::Itertools as _;
use jj_lib::absorb::AbsorbError;
use jj_lib::backend::BackendError;
use jj_lib::config::ConfigFileSaveError;
use jj_lib::config::ConfigGetError;
@@ -590,6 +591,15 @@ impl From<ParseBulkEditMessageError> for CommandError {
}
}

impl From<AbsorbError> for CommandError {
fn from(err: AbsorbError) -> Self {
match err {
AbsorbError::Backend(err) => err.into(),
AbsorbError::RevsetEvaluation(err) => err.into(),
}
}
}

fn find_source_parse_error_hint(err: &dyn error::Error) -> Option<String> {
let source = err.source()?;
if let Some(source) = source.downcast_ref() {
Loading