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
+25
View File
@@ -1367,6 +1367,31 @@ fn jj_private_fetch_discovers_never_fetched_bookmark_and_searchable_remote_chang
);
assert_eq!(changed(&comparison, Path::new("file")).after, ["local"]);
let loaded = repository.fetch_remote("origin").unwrap();
assert_eq!(loaded.graph[&tip].parents, [ancestor.clone()]);
assert_eq!(
loaded.graph[&ancestor].description,
"remote historic needle"
);
assert!(!loaded.graph[&tip].current);
let positions: std::collections::BTreeMap<_, _> = loaded
.entries
.iter()
.filter(|entry| entry.category == Category::Revisions)
.enumerate()
.filter_map(|(index, entry)| match &entry.target {
RevisionTarget::Commit(id) => Some((id.as_str(), index)),
_ => None,
})
.collect();
for (id, metadata) in &loaded.graph {
for parent in &metadata.parents {
if let (Some(child), Some(parent)) =
(positions.get(id.as_str()), positions.get(parent.as_str()))
{
assert!(child < parent);
}
}
}
let historic = loaded
.entries
.iter()