Apply rustfmt

Reviewed By: zertosh

Differential Revision: D38485039

fbshipit-source-id: d94657aa2a49e5606a91a8b28fbe3fa1711e1ac0
This commit is contained in:
Stiopa Koltsov 2022-08-06 09:10:10 -07:00 committed by Facebook GitHub Bot
parent bd2ef43ea0
commit 500536c011
54 changed files with 164 additions and 168 deletions

View File

@ -5,21 +5,6 @@
* GNU General Public License version 2.
*/
use anyhow::anyhow;
use anyhow::Context;
use atomicfile::atomic_write;
use byteorder::BigEndian;
use byteorder::ReadBytesExt;
use edenfs_error::EdenFsError;
use edenfs_error::Result;
use edenfs_error::ResultExt;
use edenfs_utils::path_from_bytes;
#[cfg(windows)]
use edenfs_utils::strip_unc_prefix;
use serde::Deserialize;
use serde::Deserializer;
use serde::Serialize;
use serde::Serializer;
use std::collections::BTreeMap;
use std::collections::HashSet;
use std::env;
@ -36,15 +21,29 @@ use std::os::unix::fs::PermissionsExt;
use std::path::Path;
use std::path::PathBuf;
use std::process::Command;
use std::time::Duration;
use std::vec;
use anyhow::anyhow;
use anyhow::Context;
use atomicfile::atomic_write;
use byteorder::BigEndian;
use byteorder::ReadBytesExt;
use edenfs_error::EdenFsError;
use edenfs_error::Result;
use edenfs_error::ResultExt;
use edenfs_utils::path_from_bytes;
#[cfg(windows)]
use edenfs_utils::strip_unc_prefix;
use serde::Deserialize;
use serde::Deserializer;
use serde::Serialize;
use serde::Serializer;
use thrift_types::edenfs::types::Glob;
use thrift_types::edenfs::types::GlobParams;
use thrift_types::edenfs::types::MountInfo;
use thrift_types::edenfs::types::MountState;
use thrift_types::edenfs::types::PredictiveFetch;
use toml::value::Value;
use uuid::Uuid;

View File

@ -15,7 +15,6 @@ use std::time::Duration;
use anyhow::anyhow;
use anyhow::Context;
use edenfs_config::EdenFsConfig;
use edenfs_error::EdenFsError;
use edenfs_error::Result;

View File

@ -5,12 +5,13 @@
* GNU General Public License version 2.
*/
use std::path::PathBuf;
use anyhow::anyhow;
use edenfs_error::EdenFsError;
use edenfs_error::Result;
use edenfs_error::ResultExt;
use regex::Regex;
use std::path::PathBuf;
use subprocess::Exec;
use subprocess::Redirection;

View File

@ -5,6 +5,13 @@
* GNU General Public License version 2.
*/
use std::collections::BTreeMap;
use std::fmt;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
use std::str::FromStr;
use anyhow::anyhow;
use edenfs_error::EdenFsError;
use edenfs_error::Result;
@ -13,12 +20,6 @@ use edenfs_utils::metadata::MetadataExt;
use serde::Deserialize;
use serde::Deserializer;
use serde::Serialize;
use std::collections::BTreeMap;
use std::fmt;
use std::fs;
use std::path::Path;
use std::path::PathBuf;
use std::str::FromStr;
use subprocess::Exec;
use subprocess::Redirection as SubprocessRedirection;
use toml::value::Value;

View File

@ -6,6 +6,7 @@
*/
use std::path::PathBuf;
use sysinfo::ProcessExt;
use sysinfo::SystemExt;
use tracing::trace;

View File

@ -9,7 +9,6 @@
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;

View File

@ -9,7 +9,6 @@
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;

View File

@ -9,7 +9,6 @@
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
use edenfs_error::ResultExt;

View File

@ -9,7 +9,6 @@
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
use edenfs_error::ResultExt;

View File

@ -7,6 +7,12 @@
//! edenfsctl du
use std::collections::HashSet;
use std::fs;
use std::fs::DirEntry;
use std::path::Path;
use std::path::PathBuf;
use anyhow::anyhow;
use async_trait::async_trait;
use clap::Parser;
@ -16,15 +22,6 @@ use comfy_table::CellAlignment;
use comfy_table::Color;
use comfy_table::Row;
use comfy_table::Table;
use serde::Serialize;
use std::collections::HashSet;
use std::fs;
use std::fs::DirEntry;
use std::path::Path;
use std::path::PathBuf;
use subprocess::Exec;
use subprocess::Redirection;
use edenfs_client::checkout::find_checkout;
use edenfs_client::checkout::EdenFsCheckout;
use edenfs_client::redirect::get_effective_redirections;
@ -39,6 +36,9 @@ use edenfs_utils::get_env_with_buck_version;
use edenfs_utils::get_environment_suitable_for_subprocess;
use edenfs_utils::metadata::MetadataExt;
use edenfs_utils::path_from_bytes;
use serde::Serialize;
use subprocess::Exec;
use subprocess::Redirection;
use crate::ExitCode;

View File

@ -12,7 +12,6 @@ use std::io::Write;
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
use edenfs_error::ResultExt;

View File

@ -10,12 +10,11 @@ use std::path::PathBuf;
use anyhow::Context;
use async_trait::async_trait;
use clap::Parser;
use tracing::event;
use tracing::Level;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
use hg_util::path::expand_path;
use tracing::event;
use tracing::Level;
mod config;
mod debug;

View File

@ -7,6 +7,15 @@
//! edenfsctl minitop
use std::collections::BTreeMap;
use std::io::stdout;
use std::io::Stdout;
use std::io::Write;
use std::path::Path;
use std::time::Duration;
use std::time::Instant;
use anyhow::anyhow;
use async_trait::async_trait;
use clap::Parser;
use comfy_table::presets::UTF8_BORDERS_ONLY;
@ -20,21 +29,6 @@ use crossterm::event::KeyModifiers;
use crossterm::queue;
use crossterm::style;
use crossterm::terminal;
use futures::FutureExt;
use futures::StreamExt;
use shlex::quote;
use std::collections::BTreeMap;
use std::io::stdout;
use std::io::Stdout;
use std::io::Write;
use std::path::Path;
use std::time::Duration;
use std::time::Instant;
use sysinfo::Pid;
use sysinfo::System;
use sysinfo::SystemExt;
use anyhow::anyhow;
use edenfs_client::EdenFsClient;
use edenfs_client::EdenFsInstance;
use edenfs_error::EdenFsError;
@ -43,7 +37,12 @@ use edenfs_error::ResultExt;
use edenfs_utils::humantime::HumanTime;
use edenfs_utils::humantime::TimeUnit;
use edenfs_utils::path_from_bytes;
use futures::FutureExt;
use futures::StreamExt;
use shlex::quote;
use sysinfo::Pid;
use sysinfo::System;
use sysinfo::SystemExt;
use thrift_types::edenfs::types::pid_t;
use thrift_types::edenfs::types::AccessCounts;
use thrift_types::edenfs::types::GetAccessCountsResult;

View File

@ -9,7 +9,6 @@
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;

View File

@ -7,30 +7,29 @@
//! edenfsctl prefetch-profile
use anyhow::anyhow;
use anyhow::Context;
use async_trait::async_trait;
use clap::Parser;
use hg_util::path::expand_path;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;
use std::str;
use anyhow::anyhow;
use anyhow::Context;
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::checkout::find_checkout;
use edenfs_client::checkout::CheckoutConfig;
use edenfs_client::EdenFsInstance;
use edenfs_error::EdenFsError;
use edenfs_error::Result;
use edenfs_error::ResultExt;
#[cfg(fbcode_build)]
use edenfs_telemetry::prefetch_profile::PrefetchProfileSample;
#[cfg(fbcode_build)]
use edenfs_telemetry::send;
#[cfg(fbcode_build)]
use fbinit::expect_init;
use hg_util::path::expand_path;
use crate::util::expand_path_or_cwd;
use crate::ExitCode;

View File

@ -7,16 +7,14 @@
//! edenfsctl redirect
use std::collections::BTreeMap;
use std::path::Path;
use std::path::PathBuf;
use anyhow::anyhow;
use anyhow::Context;
use async_trait::async_trait;
use clap::Parser;
use std::collections::BTreeMap;
use std::path::Path;
use std::path::PathBuf;
use tabular::row;
use tabular::Table;
use edenfs_client::checkout::find_checkout;
use edenfs_client::redirect::get_effective_redirections;
use edenfs_client::redirect::Redirection;
@ -24,6 +22,8 @@ use edenfs_client::redirect::RedirectionState;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
use hg_util::path::expand_path;
use tabular::row;
use tabular::Table;
use crate::util::expand_path_or_cwd;
use crate::ExitCode;

View File

@ -12,13 +12,12 @@ use std::time::Duration;
use anyhow::anyhow;
use async_trait::async_trait;
use clap::Parser;
use tokio::time;
use tracing::event;
use tracing::Level;
use edenfs_client::DaemonHealthy;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
use tokio::time;
use tracing::event;
use tracing::Level;
use crate::ExitCode;

View File

@ -7,13 +7,15 @@
//! edenfsctl top
use async_trait::async_trait;
use clap::Parser;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering;
use std::sync::RwLock;
use std::time::Duration;
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
use once_cell::sync::Lazy;
use termwiz::caps::Capabilities;
use termwiz::color::ColorAttribute;
@ -33,9 +35,6 @@ use termwiz::widgets::Widget;
use termwiz::widgets::WidgetEvent;
use termwiz::Error;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
use crate::ExitCode;
#[derive(Parser, Debug)]

View File

@ -11,7 +11,6 @@ use std::time::Duration;
use async_trait::async_trait;
use clap::Parser;
use edenfs_client::DaemonHealthy;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;

View File

@ -5,10 +5,11 @@
* GNU General Public License version 2.
*/
use std::path::PathBuf;
use anyhow::Context;
use anyhow::Result;
use hg_util::path::expand_path;
use std::path::PathBuf;
/// Expand the path if the user has supplied anything. Otherwise, use the current working directory instead.
///

View File

@ -9,6 +9,7 @@ use std::path::Path;
use anyhow::Context;
use anyhow::Result;
use edenfs_error::EdenFsError;
use serde::Deserialize;
use serde::Serialize;
use stack_config::StackConfig;
@ -16,8 +17,6 @@ use tracing::event;
use tracing::trace;
use tracing::Level;
use edenfs_error::EdenFsError;
#[derive(Serialize, Deserialize, StackConfig, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Core {

View File

@ -7,13 +7,14 @@
//! EdenFS utils
use std::ffi::OsString;
use std::path::Path;
use std::path::PathBuf;
use anyhow::anyhow;
use edenfs_error::EdenFsError;
use edenfs_error::Result;
use edenfs_error::ResultExt;
use std::ffi::OsString;
use std::path::Path;
use std::path::PathBuf;
use subprocess::Exec;
use subprocess::Redirection;

View File

@ -6,9 +6,6 @@
*/
use std::fs::Metadata;
#[cfg(any(target_os = "macos", target_os = "linux"))]
use nix::sys::stat::Mode;
#[cfg(target_os = "linux")]
use std::os::linux::fs::MetadataExt as MetadataLinuxExt;
#[cfg(target_os = "macos")]
@ -16,6 +13,9 @@ use std::os::unix::fs::MetadataExt as MetadataMacosExt;
#[cfg(windows)]
use std::os::windows::fs::MetadataExt as MetadataWindowsExt;
#[cfg(any(target_os = "macos", target_os = "linux"))]
use nix::sys::stat::Mode;
/// Metadata helper methods that map equivalent methods for the
/// edenfs purposes
pub trait MetadataExt {

View File

@ -15,15 +15,14 @@ use anyhow::anyhow;
use anyhow::Context;
use anyhow::Result;
use clap::Parser;
use fbinit::FacebookInit;
use tracing_subscriber::filter::EnvFilter;
#[cfg(fbcode_build)]
use edenfs_telemetry::cli_usage::CliUsageSample;
#[cfg(fbcode_build)]
use edenfs_telemetry::send;
#[cfg(windows)]
use edenfs_utils::strip_unc_prefix;
use fbinit::FacebookInit;
use tracing_subscriber::filter::EnvFilter;
#[cfg(windows)]
const PYTHON_CANDIDATES: &[&str] = &[

View File

@ -4,13 +4,15 @@
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use crate::EagerRepoStore;
use std::sync::Arc;
use cpython::*;
use cpython_ext::convert::register_into;
use std::sync::Arc;
use storemodel::ReadFileContents;
use storemodel::TreeStore;
use crate::EagerRepoStore;
pub(crate) fn register(py: Python) {
register_into(py, |py, obj: EagerRepoStore| obj.to_dyn_treestore(py));
register_into(py, |py, obj: EagerRepoStore| obj.to_read_file_contents(py));

View File

@ -5,11 +5,12 @@
* GNU General Public License version 2.
*/
use std::cell::RefCell;
use cpython::*;
use cpython_ext::PyNone;
use cpython_ext::PyPath;
use cpython_ext::ResultPyErrExt;
use std::cell::RefCell;
pub fn init_module(py: Python, package: &str) -> PyResult<PyModule> {
let name = [package, "indexedlog"].join(".");

View File

@ -16,7 +16,6 @@ use cpython_ext::PyPathBuf;
use futures::stream::BoxStream;
use futures::stream::StreamExt;
use minibytes::Bytes;
use storemodel::ReadFileContents;
use types::Key;

View File

@ -8,7 +8,6 @@
use cpython::PyResult;
use cpython::Python;
use cpython::*;
use hgcommands::prepare_builtin_modules;
py_module_initializer!(bindings, initbindings, PyInit_bindings, |py, m| {

View File

@ -11,14 +11,6 @@
//! It is intended to be used together with edenfs, but may also be
//! useful for non-virtualized repos as a way to move IO out of a recursive
//! watch.
use anyhow::anyhow;
use anyhow::bail;
use anyhow::format_err;
use anyhow::Context;
use anyhow::Result;
use serde::*;
use sha2::Digest;
use sha2::Sha256;
use std::os::unix::fs::MetadataExt;
use std::os::unix::process::CommandExt;
use std::path::Path;
@ -27,6 +19,15 @@ use std::process::Command;
use std::process::Stdio;
use std::str;
use std::time::Duration;
use anyhow::anyhow;
use anyhow::bail;
use anyhow::format_err;
use anyhow::Context;
use anyhow::Result;
use serde::*;
use sha2::Digest;
use sha2::Sha256;
use structopt::StructOpt;
#[cfg(feature = "fb")]
@ -928,9 +929,10 @@ fn main() -> Result<()> {
// system at fb.
#[cfg(test)]
mod test {
use super::*;
use pretty_assertions::assert_eq;
use super::*;
#[cfg_attr(any(target_os = "macos", feature = "native-plist"), test)]
#[cfg_attr(
not(any(target_os = "macos", feature = "native-plist")),

View File

@ -5,8 +5,6 @@
* GNU General Public License version 2.
*/
use anyhow::bail;
use anyhow::Result;
use std::fmt;
use std::fs::create_dir;
use std::fs::create_dir_all;
@ -27,6 +25,9 @@ use std::sync::mpsc::TrySendError;
use std::sync::Arc;
use std::thread;
use std::time::Instant;
use anyhow::bail;
use anyhow::Result;
use structopt::StructOpt;
#[derive(StructOpt)]

View File

@ -5,9 +5,10 @@
* GNU General Public License version 2.
*/
use std::path::Path;
use anyhow::format_err;
use anyhow::Error;
use std::path::Path;
use winapi::shared::minwindef::DWORD;
use winapi::um::consoleapi::GetConsoleMode;
use winapi::um::consoleapi::SetConsoleMode;

View File

@ -7,6 +7,11 @@
pub mod error;
use std::fs::File;
use std::io::Read;
#[cfg(target_os = "macos")]
use std::io::Write;
use anyhow::bail;
use anyhow::Result;
use clap::App;
@ -16,11 +21,6 @@ use commitcloudsubscriber::CommitCloudTcpReceiverService;
use commitcloudsubscriber::CommitCloudWorkspaceSubscriberService;
use log::info;
use serde::Deserialize;
use std::fs::File;
use std::io::Read;
#[cfg(target_os = "macos")]
use std::io::Write;
/// This is what we're going to decode toml config into.
/// Each field is optional, meaning that it doesn't have to be present in TOML.

View File

@ -13,6 +13,16 @@
//! may want to use watchman to watch a portion of the scratch space
//! and can arrange the directory structure to prevent over-watching.
use std::collections::HashMap;
use std::env;
use std::fs;
use std::io::prelude::*;
#[cfg(unix)]
use std::os::unix::fs::MetadataExt;
use std::path::Component;
use std::path::Path;
use std::path::PathBuf;
use anyhow::bail;
#[cfg(unix)]
use anyhow::ensure;
@ -23,15 +33,6 @@ use clap::AppSettings;
use clap::Arg;
use clap::SubCommand;
use serde::Deserialize;
use std::collections::HashMap;
use std::env;
use std::fs;
use std::io::prelude::*;
#[cfg(unix)]
use std::os::unix::fs::MetadataExt;
use std::path::Component;
use std::path::Path;
use std::path::PathBuf;
/// Configuration for scratch space style. This decides whether the directory
/// structure is kept exactly as provided subdir or not.

View File

@ -7,12 +7,11 @@
use std::path::PathBuf;
use structopt::StructOpt;
use revisionstore::datapack::DataPack;
use revisionstore::datastore::DataStore;
use revisionstore::localstore::ExtStoredPolicy;
use revisionstore::uniondatastore::UnionDataStore;
use structopt::StructOpt;
use types::Key;
use types::Node;
use types::RepoPathBuf;

View File

@ -11,12 +11,11 @@ use std::sync::Arc;
use anyhow::format_err;
use anyhow::Result;
use bytes::Bytes;
use structopt::StructOpt;
use pathmatcher::AlwaysMatcher;
use revisionstore::datapack::DataPack;
use revisionstore::datastore::DataStore;
use revisionstore::uniondatastore::UnionDataStore;
use structopt::StructOpt;
use types::HgId;
use types::Key;
use types::RepoPath;

View File

@ -9,7 +9,6 @@ use std::env;
use std::path::Path;
use std::sync::atomic::Ordering::SeqCst;
use crate::OptionalRepo;
use anyhow::Error;
use cliparser::alias::expand_aliases;
use cliparser::alias::find_command_name;
@ -26,6 +25,7 @@ use crate::command::CommandTable;
use crate::errors;
use crate::global_flags::HgGlobalOpts;
use crate::io::IO;
use crate::OptionalRepo;
type Result<T, E = Error> = std::result::Result<T, E>;

View File

@ -16,5 +16,4 @@ pub mod output;
pub mod util;
pub use io;
pub use optional_repo::OptionalRepo;

View File

@ -355,10 +355,11 @@ impl TestDag {
#[cfg(test)]
/// Dump Dag segments as ASCII string.
pub fn dump_segments_ascii(&self) -> String {
use std::collections::HashSet;
use crate::Id;
use crate::IdSet;
use crate::IdSpan;
use std::collections::HashSet;
let span_iter = |span: IdSpan| IdSet::from_spans(vec![span]).into_iter().rev();
let iddag = &self.dag.dag;

View File

@ -7,10 +7,11 @@
extern crate proc_macro;
use std::collections::HashSet;
use proc_macro2::TokenStream;
use quote::format_ident;
use quote::quote;
use std::collections::HashSet;
use syn::spanned::Spanned;
use syn::*;

View File

@ -5,11 +5,12 @@
* GNU General Public License version 2.
*/
use std::collections::HashMap;
#[cfg(any(test, feature = "for-tests"))]
use quickcheck_arbitrary_derive::Arbitrary;
use serde_derive::Deserialize;
use serde_derive::Serialize;
use std::collections::HashMap;
use type_macros::auto_wire;
use types::HgId;

View File

@ -5,12 +5,13 @@
* GNU General Public License version 2.
*/
use crate::git_hub_repo::GitHubRepo;
use crate::make_request::make_request;
use anyhow::Result;
use graphql_client::GraphQLQuery;
use serde::Serialize;
use crate::git_hub_repo::GitHubRepo;
use crate::make_request::make_request;
// See https://github.com/graphql-rust/graphql-client#custom-scalars
type GitObjectID = String;
#[allow(clippy::upper_case_acronyms)]

View File

@ -5,11 +5,12 @@
* GNU General Public License version 2.
*/
use crate::git_hub_repo::GitHubRepo;
use crate::make_request::make_request;
use anyhow::Result;
use graphql_client::GraphQLQuery;
use crate::git_hub_repo::GitHubRepo;
use crate::make_request::make_request;
#[derive(GraphQLQuery)]
#[graphql(
schema_path = "graphql/schema.docs.graphql",

View File

@ -12,5 +12,6 @@
mod gitstore;
mod trait_impls;
pub use crate::gitstore::GitStore;
pub use git2;
pub use crate::gitstore::GitStore;

View File

@ -28,7 +28,6 @@ use util::path::absolute;
use super::ConfigSet;
use super::Result;
use super::IO;
use crate::HgPython;
static SEGMENTED_CHANGELOG_CAPABILITY: &str = "segmented-changelog";

View File

@ -21,7 +21,6 @@ use minibytes::Text;
use super::ConfigSet;
use super::Result;
use super::IO;
use crate::commands::FormatterOpts;
define_flags! {

View File

@ -5,11 +5,12 @@
* GNU General Public License version 2.
*/
use clidispatch::errors;
use super::define_flags;
use super::ConfigSet;
use super::Result;
use super::IO;
use clidispatch::errors;
define_flags! {
pub struct DebugPythonOpts {

View File

@ -5,9 +5,10 @@
* GNU General Public License version 2.
*/
use std::collections::HashMap;
use anyhow::Result;
use clidispatch::io::IO;
use std::collections::HashMap;
use types::path::RepoPathRelativizer;
use types::RepoPath;
use types::RepoPathBuf;
@ -218,9 +219,10 @@ impl Default for PrintConfig {
#[cfg(test)]
mod test {
use super::*;
use std::str;
use super::*;
fn repo_path_buf(path: &str) -> RepoPathBuf {
RepoPathBuf::from_string(path.to_string()).unwrap()
}

View File

@ -5,13 +5,13 @@
* GNU General Public License version 2.
*/
use anyhow::Result;
use crate::errors::Abort;
use crate::errors::HttpClientError;
use crate::header::Header;
use crate::progress::Progress;
use anyhow::Result;
pub mod channel;
pub use channel::ChannelReceiver;

View File

@ -92,9 +92,8 @@ pub use path::GenericPath;
pub use self::fold::Fold;
pub use self::fold::FoldDef;
pub use self::meta::LogMetadata;
use self::fold::FoldState;
pub use self::meta::LogMetadata;
// Constants about file names
pub(crate) const PRIMARY_FILE: &str = "log";

View File

@ -17,17 +17,16 @@ mod metalog;
pub use errors::Error;
pub use errors::Result;
pub use indexedlog::Repair;
#[cfg(test)]
use lazy_static::lazy_static;
#[cfg(test)]
use parking_lot::Mutex;
pub use crate::metalog::resolver;
pub use crate::metalog::CommitOptions;
pub use crate::metalog::Id20;
pub use crate::metalog::MetaLog;
#[cfg(test)]
use lazy_static::lazy_static;
#[cfg(test)]
use parking_lot::Mutex;
#[cfg(test)]
lazy_static! {
/// Lock for the environment. This should be acquired by tests that rely on particular

View File

@ -10,7 +10,6 @@ use std::path::Path;
use std::path::PathBuf;
use std::sync::Arc;
use crate::repo::Repo;
use edenapi::EdenApi;
use hgcommits::DagCommits;
use hgcommits::DoubleWriteCommits;
@ -22,6 +21,8 @@ use hgcommits::RevlogCommits;
use metalog::MetaLog;
use parking_lot::RwLock;
use crate::repo::Repo;
static HG_COMMITS_PATH: &str = "hgcommits/v1";
static LAZY_HASH_PATH: &str = "lazyhashdir";
static SEGMENTS_PATH: &str = "segments/v1";

View File

@ -11,6 +11,7 @@ use std::io;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;
use util::errors::IOContext;
use util::errors::IOResult;
@ -84,9 +85,10 @@ impl Requirements {
#[cfg(test)]
mod tests {
use super::*;
use tempfile::tempdir;
use super::*;
#[test]
fn test_requires_basic() {
let tmp = tempdir().unwrap();

View File

@ -14,14 +14,13 @@ use serde::Deserialize;
use types::RepoPathBuf;
use watchman_client::prelude::*;
use super::treestate::WatchmanTreeStateRead;
use super::treestate::WatchmanTreeStateWrite;
use crate::filechangedetector::FileChangeDetectorTrait;
use crate::filechangedetector::FileChangeResult;
use crate::filechangedetector::ResolvedFileChangeResult;
use crate::filesystem::PendingChangeResult;
use super::treestate::WatchmanTreeStateRead;
use super::treestate::WatchmanTreeStateWrite;
query_result_type! {
pub struct StatusQuery {
name: NameField,
@ -170,19 +169,17 @@ mod tests {
use anyhow::Result;
use types::RepoPathBuf;
use watchman_client::prelude::*;
use crate::filechangedetector::FileChangeDetectorTrait;
use crate::filechangedetector::FileChangeResult;
use crate::filechangedetector::ResolvedFileChangeResult;
use crate::filesystem::ChangeType;
use crate::filesystem::PendingChangeResult;
use super::super::state::StatusQuery;
use super::super::state::WatchmanState;
use super::super::treestate::WatchmanTreeStateRead;
use super::super::treestate::WatchmanTreeStateWrite;
use crate::filechangedetector::FileChangeDetectorTrait;
use crate::filechangedetector::FileChangeResult;
use crate::filechangedetector::ResolvedFileChangeResult;
use crate::filesystem::ChangeType;
use crate::filesystem::PendingChangeResult;
#[derive(Clone)]
enum Event {

View File

@ -16,15 +16,14 @@ use treestate::treestate::TreeState;
use vfs::VFS;
use watchman_client::prelude::*;
use super::state::StatusQuery;
use super::state::WatchmanState;
use super::treestate::WatchmanTreeState;
use crate::filechangedetector::ArcReadFileContents;
use crate::filechangedetector::FileChangeDetector;
use crate::filechangedetector::HgModifiedTime;
use crate::filesystem::PendingChangeResult;
use super::state::StatusQuery;
use super::state::WatchmanState;
use super::treestate::WatchmanTreeState;
pub struct WatchmanFileSystem {
vfs: VFS,
}