feat: show jj ancestry in the floating diff picker

This commit is contained in:
Valdemar Lorenzen
2026-10-23 17:08:53 +02:00
parent 496c93774f
commit e3d44f24c0
16 changed files with 882 additions and 50 deletions
+74
View File
@@ -463,6 +463,80 @@ fn working_jj_conflicted_parent_uses_cli_projection_without_snapshotting() {
}
}
#[test]
fn jj_catalog_exposes_fixed_metadata_and_merge_parents_without_snapshotting() {
let temp = Temporary::new().unwrap();
let root = &temp.0;
fixture_command(root, "jj", &["git", "init", "--no-colocate", "."]);
fixture_command(root, "jj", &["describe", "-m", "Base"]);
let id = |root: &Path| {
fixture_command(
root,
"jj",
&[
"--ignore-working-copy",
"log",
"--no-graph",
"-r",
"@",
"-T",
"commit_id",
],
)
};
let base = id(root);
fixture_command(root, "jj", &["bookmark", "create", "base"]);
fixture_command(root, "jj", &["new", &base, "-m", "Left"]);
let left = id(root);
fixture_command(root, "jj", &["new", &base, "-m", "Right"]);
let right = id(root);
fixture_command(root, "jj", &["new", &left, &right, "-m", "Merge"]);
let current = id(root);
let operation = fixture_command(
root,
"jj",
&[
"--ignore-working-copy",
"op",
"log",
"--no-graph",
"-n",
"1",
"-T",
"id",
],
);
let mut repository = Repository::open(root, Arc::new(AtomicBool::new(false))).unwrap();
let catalog = repository.catalog().unwrap();
let merge = &catalog.graph[&current];
assert_eq!(merge.parents, [left, right]);
assert_eq!(merge.author, "Picker Author");
assert_eq!(merge.timestamp, "2001-01-01 00:00");
assert_eq!(merge.description, "Merge");
assert!(!merge.change_id.is_empty());
assert!(merge.current);
assert_eq!(catalog.graph[&base].bookmarks, "base");
assert!(!catalog.graph[&base].current);
assert!(catalog.graph[&"0".repeat(40)].immutable);
assert_eq!(
fixture_command(
root,
"jj",
&[
"--ignore-working-copy",
"op",
"log",
"--no-graph",
"-n",
"1",
"-T",
"id"
]
),
operation
);
}
#[test]
fn cancellation_kills_pipe_holding_children_and_drains_both_streams() {
let temp = Temporary::new().unwrap();