history: show DELETED marker on tombstone entries
cmd_history was silently hiding the deleted flag, making it impossible to tell from the output that a node had been deleted. This masked the kernel-patterns deletion — looked like the node existed in the log but wouldn't load. Also adds merge-logs and diag-key diagnostic binaries, and makes Node::to_capnp public for use by external tools. Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
9775d468b2
commit
81fec99767
5 changed files with 264 additions and 5 deletions
|
|
@ -256,16 +256,17 @@ pub fn cmd_history(key: &[String], full: bool) -> Result<(), String> {
|
|||
} else {
|
||||
format!("(raw:{})", node.timestamp)
|
||||
};
|
||||
let deleted_marker = if node.deleted { " DELETED" } else { "" };
|
||||
let content_len = node.content.len();
|
||||
if full {
|
||||
eprintln!("=== v{} {} {} w={:.3} {}b ===",
|
||||
node.version, ts, node.provenance, node.weight, content_len);
|
||||
eprintln!("=== v{} {} {}{} w={:.3} {}b ===",
|
||||
node.version, ts, node.provenance, deleted_marker, node.weight, content_len);
|
||||
eprintln!("{}", node.content);
|
||||
} else {
|
||||
let preview = crate::util::first_n_chars(&node.content, 120);
|
||||
let preview = preview.replace('\n', "\\n");
|
||||
eprintln!(" v{:<3} {} {:24} w={:.3} {}b",
|
||||
node.version, ts, node.provenance, node.weight, content_len);
|
||||
eprintln!(" v{:<3} {} {:24} w={:.3} {}b{}",
|
||||
node.version, ts, node.provenance, node.weight, content_len, deleted_marker);
|
||||
eprintln!(" {}", preview);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue