mononoke: dump pretty json when changing xrepo mapping

Summary: It makes it more readable

Reviewed By: ikostia

Differential Revision: D26100720

fbshipit-source-id: 7f9b37f1e3e9f4a476e89ff59740004070d066f9
This commit is contained in:
Stanislau Hlebik 2021-01-27 07:44:14 -08:00 committed by Facebook GitHub Bot
parent 339788a95e
commit 5eedbf488b
2 changed files with 15 additions and 5 deletions

View File

@ -794,7 +794,7 @@ async fn create_file_changes(
}
map.insert("overrides".to_string(), map_overrides.into());
let content = (get_generated_string() + &serde_json::to_string(&map)?).into_bytes();
let content = (get_generated_string() + &serde_json::to_string_pretty(&map)?).into_bytes();
let content = bytes::Bytes::from(content);
let size = content.len() as u64;
let content_metadata = filestore::store(

View File

@ -88,8 +88,13 @@ After the change
$ hg ci -Aqm "after config change"
$ REPONAME=small-mon hgmn push -r . --to master_bookmark -q
$ cat mapping.json
@generated by the megarepo bind, reach out to Source Control @ FB with any questions
{"default_prefix":"smallrepofolder_after","overrides":{"non_path_shifting":"non_path_shifting"}} (no-eol)
*generated by the megarepo bind, reach out to Source Control @ FB with any questions (glob)
{
"default_prefix": "smallrepofolder_after",
"overrides": {
"non_path_shifting": "non_path_shifting"
}
} (no-eol)
$ log -r master_bookmark
@ after config change [public;rev=4;*] default/master_bookmark (glob)
@ -113,5 +118,10 @@ After the change
smallrepofolder_after/boo
-- check mapping
$ cat smallrepofolder_after/mapping.json
@generated by the megarepo bind, reach out to Source Control @ FB with any questions
{"default_prefix":"smallrepofolder_after","overrides":{"non_path_shifting":"non_path_shifting"}} (no-eol)
*generated by the megarepo bind, reach out to Source Control @ FB with any questions (glob)
{
"default_prefix": "smallrepofolder_after",
"overrides": {
"non_path_shifting": "non_path_shifting"
}
} (no-eol)