Skip to content

Commit

Permalink
goto: swap redacted content for human readable message
Browse files Browse the repository at this point in the history
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
  • Loading branch information
muirdm authored and facebook-github-bot committed Jan 10, 2025
1 parent 96031b4 commit 38e239b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions eden/mononoke/tests/integration/test-redaction-config.t
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ Restart mononoke
$ hg up -q 14961831bd3a

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


Mononoke admin also won't give us the content
Expand Down
1 change: 1 addition & 0 deletions eden/scm/lib/checkout/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ anyhow = "1.0.95"
crossbeam = "0.8"
fail = { version = "0.4", features = ["failpoints"] }
parking_lot = { version = "0.12.1", features = ["send_guard"] }
redacted = { version = "0.1.0", path = "../util/redacted" }
sapling-async-runtime = { version = "0.1.0", path = "../async-runtime" }
sapling-atexit = { version = "0.1.0", path = "../util/atexit" }
sapling-configmodel = { version = "0.1.0", path = "../config/model" }
Expand Down
4 changes: 4 additions & 0 deletions eden/scm/lib/checkout/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ use pathmatcher::Matcher;
use pathmatcher::UnionMatcher;
use progress_model::ProgressBar;
use progress_model::Registry;
use redacted::redact_if_needed;
use repo::repo::Repo;
use serde::Deserialize;
use storemodel::FileStore;
Expand Down Expand Up @@ -355,6 +356,9 @@ impl CheckoutPlan {
}
Ok(v) => v,
};

let data = redact_if_needed(data);

let action = actions
.get(&key)
.ok_or_else(|| format_err!("Storage returned unknown key {}", key))?;
Expand Down

0 comments on commit 38e239b

Please sign in to comment.