mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
indexedlog: move binary indexedlog_dump out
Summary: It makes testing duplicated - now `cargo test` would try running tests on 2 entry points: lib.rs and indexedlog_dump.rs. Move it to a separate crate to solve the issue. Reviewed By: markbt Differential Revision: D13498266 fbshipit-source-id: 8abf07c1272dfa825ec7701fd8ea9e0d1310ec5f
This commit is contained in:
parent
ce243170da
commit
443a8f33b3
6
exec/utils/Cargo.toml
Normal file
6
exec/utils/Cargo.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "utils"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
indexedlog = { path = "../../lib/indexedlog" }
|
@ -11,20 +11,7 @@
|
||||
// Write code paths are not used.
|
||||
#![allow(dead_code)]
|
||||
|
||||
extern crate atomicwrites;
|
||||
extern crate byteorder;
|
||||
extern crate fs2;
|
||||
extern crate memmap;
|
||||
extern crate twox_hash;
|
||||
extern crate vlqencoding;
|
||||
|
||||
mod base16;
|
||||
mod checksum_table;
|
||||
mod index;
|
||||
mod lock;
|
||||
mod log;
|
||||
mod utils;
|
||||
|
||||
extern crate indexedlog;
|
||||
use std::{env, path::Path};
|
||||
|
||||
fn main() {
|
||||
@ -32,11 +19,11 @@ fn main() {
|
||||
let path = Path::new(&arg);
|
||||
if path.is_dir() {
|
||||
// Treate it as Log.
|
||||
let log = log::Log::open(path, Vec::new()).unwrap();
|
||||
let log = indexedlog::log::Log::open(path, Vec::new()).unwrap();
|
||||
println!("Log Directory {:?}:\n{:#?}\n", path, log);
|
||||
} else if path.is_file() {
|
||||
// Treate it as Index.
|
||||
let idx = index::OpenOptions::new().open(path).unwrap();
|
||||
let idx = indexedlog::index::OpenOptions::new().open(path).unwrap();
|
||||
println!("Index File {:?}\n{:?}\n", path, idx);
|
||||
} else {
|
||||
println!(
|
@ -28,6 +28,3 @@ harness = false
|
||||
name = "log"
|
||||
harness = false
|
||||
|
||||
[[bin]]
|
||||
name = "indexedlog-dump"
|
||||
path = "src/indexedlog_dump.rs"
|
||||
|
Loading…
Reference in New Issue
Block a user