mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-12 07:24:11 +00:00
files: implement Debug for MergeResult, display byte vector as string
This commit is contained in:
parent
856b219943
commit
f6839a4ceb
1 changed files with 13 additions and 1 deletions
|
@ -192,12 +192,24 @@ impl Debug for MergeHunk {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
#[derive(PartialEq, Eq, Clone)]
|
||||||
pub enum MergeResult {
|
pub enum MergeResult {
|
||||||
Resolved(Vec<u8>),
|
Resolved(Vec<u8>),
|
||||||
Conflict(Vec<MergeHunk>),
|
Conflict(Vec<MergeHunk>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Debug for MergeResult {
|
||||||
|
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> {
|
||||||
|
match self {
|
||||||
|
MergeResult::Resolved(data) => f
|
||||||
|
.debug_tuple("Resolved")
|
||||||
|
.field(&String::from_utf8_lossy(data))
|
||||||
|
.finish(),
|
||||||
|
MergeResult::Conflict(hunks) => f.debug_tuple("Conflict").field(hunks).finish(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A region where the base and two sides match.
|
/// A region where the base and two sides match.
|
||||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
struct SyncRegion {
|
struct SyncRegion {
|
||||||
|
|
Loading…
Reference in a new issue