mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-29 23:57:51 +00:00
absorb: move core functionality from cli to lib
This commit is contained in:
parent
2a563039a5
commit
396833f803
4 changed files with 1145 additions and 1084 deletions
|
@ -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() {
|
||||
|
|
File diff suppressed because it is too large
Load diff
1116
lib/src/absorb.rs
Normal file
1116
lib/src/absorb.rs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -28,6 +28,7 @@ extern crate self as jj_lib;
|
|||
#[macro_use]
|
||||
pub mod content_hash;
|
||||
|
||||
pub mod absorb;
|
||||
pub mod annotate;
|
||||
pub mod backend;
|
||||
pub mod commit;
|
||||
|
|
Loading…
Reference in a new issue