Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
jj workspace can have its own Git HEAD. Existing repositories are migrated
automatically.

* The new `jj converge` command attempts to automatically resolve divergence by
creating a new commit that replaces the divergent commits. It applies
heuristics to try to automatically come up with a good solution, and falls
back to prompting the user if the heuristics are inconclusive. It can also run
in non-interactive mode, which aborts if prompting would be needed.

### Fixed bugs

* The default pager flags now include `-K` (`--quit-on-intr`), so pressing
Expand Down
24 changes: 23 additions & 1 deletion cli/src/command_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use jj_lib::config::ConfigFileSaveError;
use jj_lib::config::ConfigGetError;
use jj_lib::config::ConfigLoadError;
use jj_lib::config::ConfigMigrateError;
use jj_lib::converge::ConvergeError;
use jj_lib::dsl_util::Diagnostics;
use jj_lib::evolution::WalkPredecessorsError;
use jj_lib::fileset::FilePatternParseError;
Expand Down Expand Up @@ -427,6 +428,19 @@ impl From<WalkPredecessorsError> for CommandError {
}
}

impl From<ConvergeError> for CommandError {
fn from(err: ConvergeError) -> Self {
match err {
ConvergeError::Backend(err) => err.into(),
ConvergeError::Index(err) => err.into(),
ConvergeError::RevsetEvaluation(err) => err.into(),
ConvergeError::WalkPredecessors(err) => err.into(),
ConvergeError::IO(err) => err.into(),
ConvergeError::Other(err) => internal_error(err),
}
}
}

impl From<DiffEditError> for CommandError {
fn from(err: DiffEditError) -> Self {
user_error_with_message("Failed to edit diff", err)
Expand Down Expand Up @@ -507,6 +521,12 @@ impl From<TempTextEditError> for CommandError {
}
}

impl From<TempTextEditError> for ConvergeError {
fn from(err: TempTextEditError) -> Self {
Self::Other(Box::new(err))
}
}

impl From<TrailerParseError> for CommandError {
fn from(err: TrailerParseError) -> Self {
user_error(err)
Expand Down Expand Up @@ -936,7 +956,9 @@ fn revset_resolution_error_hints(err: &RevsetResolutionError) -> Vec<String> {
kind: _,
symbol: _,
targets,
} => vec![multiple_targets_hint(targets)],
} => {
vec![multiple_targets_hint(targets)]
}
RevsetResolutionError::EmptyString
| RevsetResolutionError::WorkspaceMissingWorkingCopy { .. }
| RevsetResolutionError::AmbiguousCommitIdPrefix(_)
Expand Down
Loading