Skip to content

Commit 38e239b

Browse files
muirdmfacebook-github-bot
authored andcommitted
goto: swap redacted content for human readable message
Summary: When checking out files, if the content matches the redacted tombstone, swap the contents to a human readable message. This logic was missing from the Rust checkout. I considered adding this logic deeper in the scmstore FileStore object, but I didn't like that since it would make it hard for us to see the "real" content served by the server. Only performing the substitution for the working copy manifestation of the contents seems better. Reviewed By: quark-zju, andreacampi Differential Revision: D67958797 fbshipit-source-id: 73d6cddcee53530e562b5df543584a4f0f85fab0
1 parent 96031b4 commit 38e239b

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

eden/mononoke/tests/integration/test-redaction-config.t

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,8 @@ Restart mononoke
144144
$ hg up -q 14961831bd3a
145145

146146
Should gives us the tombstone file since it is redacted
147-
FIXME: should show message for human
148147
$ cat b
149-
PoUOK1GkdH6Xtx5j9WKYew3dZXspyfkahcNkhV6MJ4rhyNICTvX0nxmbCImFoT0oHAF9ivWGaC6ByswQZUgf1nlyxcDcahHknJS15Vl9Lvc4NokYhMg0mV1rapq1a4bhNoUI9EWTBiAkYmkadkO3YQXV0TAjyhUQWxxLVskjOwiiFPdL1l1pdYYCLTE3CpgOoxQV3EPVxGUPh1FGfk7F9Myv22qN1sUPSNN4h3IFfm2NNPRFgWPDsqAcaQ7BUSKa
148+
This version of the file is redacted and you are not allowed to access it. Update or rebase to a newer commit.
150149

151150

152151
Mononoke admin also won't give us the content

eden/scm/lib/checkout/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ anyhow = "1.0.95"
1717
crossbeam = "0.8"
1818
fail = { version = "0.4", features = ["failpoints"] }
1919
parking_lot = { version = "0.12.1", features = ["send_guard"] }
20+
redacted = { version = "0.1.0", path = "../util/redacted" }
2021
sapling-async-runtime = { version = "0.1.0", path = "../async-runtime" }
2122
sapling-atexit = { version = "0.1.0", path = "../util/atexit" }
2223
sapling-configmodel = { version = "0.1.0", path = "../config/model" }

eden/scm/lib/checkout/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use pathmatcher::Matcher;
4343
use pathmatcher::UnionMatcher;
4444
use progress_model::ProgressBar;
4545
use progress_model::Registry;
46+
use redacted::redact_if_needed;
4647
use repo::repo::Repo;
4748
use serde::Deserialize;
4849
use storemodel::FileStore;
@@ -355,6 +356,9 @@ impl CheckoutPlan {
355356
}
356357
Ok(v) => v,
357358
};
359+
360+
let data = redact_if_needed(data);
361+
358362
let action = actions
359363
.get(&key)
360364
.ok_or_else(|| format_err!("Storage returned unknown key {}", key))?;

0 commit comments

Comments
 (0)