Skip to content

Commit 96031b4

Browse files
muirdmfacebook-github-bot
authored andcommitted
revisionstore: move redacted utilities to separate crate
Summary: I want to use these from the "checkout" crate without depending on the heavy "revisionstore" crate. Reviewed By: zzl0 Differential Revision: D67958798 fbshipit-source-id: e7db7ea6c460ea8af394f27b762f8dd9d8ba50e7
1 parent dd0df16 commit 96031b4

File tree

8 files changed

+15
-6
lines changed

8 files changed

+15
-6
lines changed

eden/scm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ members = [
182182
"lib/util/nodeipc/derive",
183183
"lib/util/procutil",
184184
"lib/util/pubsub",
185+
"lib/util/redacted",
185186
"lib/util/rewrite-macros",
186187
"lib/util/rewrite-macros/tree-pattern-match",
187188
"lib/util/testutil",

eden/scm/lib/revisionstore/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ paste = "1.0.14"
3030
quickcheck = "1.0"
3131
quickcheck_arbitrary_derive = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" }
3232
rand = { version = "0.8", features = ["small_rng"] }
33+
redacted = { version = "0.1.0", path = "../util/redacted" }
3334
sapling-async-runtime = { version = "0.1.0", path = "../async-runtime" }
3435
sapling-cas-client = { version = "0.1.0", path = "../cas-client" }
3536
sapling-clientinfo = { version = "0.1.0", path = "../clientinfo" }

eden/scm/lib/revisionstore/src/lfs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ use minibytes::Bytes;
7878
use parking_lot::Mutex;
7979
use rand::thread_rng;
8080
use rand::Rng;
81+
use redacted::is_redacted;
8182
use serde_derive::Deserialize;
8283
use serde_derive::Serialize;
8384
use storemodel::SerializationFormat;
@@ -112,8 +113,6 @@ use crate::historystore::RemoteHistoryStore;
112113
use crate::indexedlogutil::Store;
113114
use crate::indexedlogutil::StoreOpenOptions;
114115
use crate::localstore::LocalStore;
115-
use crate::redacted;
116-
use crate::redacted::is_redacted;
117116
use crate::remotestore::HgIdRemoteStore;
118117
use crate::types::ContentHash;
119118
use crate::types::StoreKey;

eden/scm/lib/revisionstore/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ mod indexedlogutil;
107107
mod lfs;
108108
mod metadatastore;
109109
mod missing;
110-
mod redacted;
111110
mod remotestore;
112111
mod repair;
113112
mod sliceext;
@@ -154,7 +153,6 @@ pub use crate::lfs::LfsRemote;
154153
pub use crate::localstore::LocalStore;
155154
pub use crate::metadatastore::MetadataStore;
156155
pub use crate::metadatastore::MetadataStoreBuilder;
157-
pub use crate::redacted::redact_if_needed;
158156
pub use crate::remotestore::HgIdRemoteStore;
159157
pub use crate::repair::repair;
160158
pub use crate::types::ContentHash;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# @generated by autocargo from //eden/scm/lib/util/redacted:redacted
2+
3+
[package]
4+
name = "redacted"
5+
version = "0.1.0"
6+
edition = "2021"
7+
8+
[dependencies]
9+
sapling-minibytes = { version = "0.1.0", path = "../../minibytes" }
File renamed without changes.

eden/scm/saplingnative/bindings/modules/pyworker/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ anyhow = "1.0.95"
1010
cpython = { version = "0.7.2", default-features = false }
1111
crossbeam = "0.8"
1212
pyrevisionstore = { version = "0.1.0", path = "../pyrevisionstore" }
13+
redacted = { version = "0.1.0", path = "../../../../lib/util/redacted" }
1314
sapling-cpython-ext = { version = "0.1.0", path = "../../../../lib/cpython-ext" }
1415
sapling-revisionstore = { version = "0.1.0", path = "../../../../lib/revisionstore" }
1516
sapling-storemodel = { version = "0.1.0", path = "../../../../lib/storemodel" }

eden/scm/saplingnative/bindings/modules/pyworker/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crossbeam::channel::bounded;
2828
use crossbeam::channel::Receiver;
2929
use crossbeam::channel::Sender;
3030
use pyrevisionstore::filescmstore;
31-
use revisionstore::redact_if_needed;
31+
use redacted::redact_if_needed;
3232
use revisionstore::scmstore::FileStore;
3333
use revisionstore::trait_impls::ArcFileStore;
3434
use storemodel::KeyStore;
@@ -107,7 +107,7 @@ impl<Ret: Send + 'static, Work: Sync + Send + 'static> Worker<Ret, Work> {
107107
/// performance.
108108
/// 3) Since pushing work to the worker is single threaded, the batched work
109109
/// has a high chance of being on the same files, increasing locality.
110-
///
110+
///
111111
/// Caveat: the batch size was chosen semi-arbitrarily, and should be
112112
/// tweaked, too high of a value, and the progress reporting won't be
113113
/// good, too small of a value and the performance will suffer.

0 commit comments

Comments
 (0)