Skip to content

Commit

Permalink
absorb: move core functionality from cli to lib
Browse files Browse the repository at this point in the history
  • Loading branch information
torquestomp committed Dec 17, 2024
1 parent 2a56303 commit 396833f
Show file tree
Hide file tree
Showing 4 changed files with 1,145 additions and 1,084 deletions.
10 changes: 10 additions & 0 deletions cli/src/command_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
Loading

0 comments on commit 396833f

Please sign in to comment.