mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
indexedlog_dump: make it support dumping meta files
Summary: This make it easier to check the integrity and content of indexedlog metadata files. Reviewed By: xavierd Differential Revision: D16077683 fbshipit-source-id: 7142856e6f0a73add832a71a416a58bb3580686f
This commit is contained in:
parent
02877bf4ce
commit
f169d6cc42
@ -17,7 +17,9 @@ use std::{env, path::Path};
|
||||
fn main() {
|
||||
for arg in env::args().skip(1) {
|
||||
let path = Path::new(&arg);
|
||||
if path.is_dir() {
|
||||
if let Ok(meta) = indexedlog::log::LogMetadata::read_file(path) {
|
||||
println!("Metadata File {:?}\n{:?}\n", path, meta);
|
||||
} else if path.is_dir() {
|
||||
// Treate it as Log.
|
||||
let log = indexedlog::log::Log::open(path, Vec::new()).unwrap();
|
||||
println!("Log Directory {:?}:\n{:#?}\n", path, log);
|
||||
|
Loading…
Reference in New Issue
Block a user