Skip to content

Commit

Permalink
bootstrap: improve fn check_version
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Nov 8, 2023
1 parent ae4d18b commit e878100
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/bootstrap/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,29 +110,29 @@ fn check_version(config: &Config) -> Option<String> {

let latest_config_id = CONFIG_CHANGE_HISTORY.last().unwrap();
if let Some(id) = config.change_id {
if &id != latest_config_id {
let change_links: Vec<String> = find_recent_config_change_ids(id)
.iter()
.map(|id| format!("https://github.com/rust-lang/rust/pull/{id}"))
.collect();
if !change_links.is_empty() {
msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
msg.push_str("To see more detail about these changes, visit the following PRs:\n");

for link in change_links {
msg.push_str(&format!(" - {link}\n"));
}

msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");

msg.push_str("note: to silence this warning, ");
msg.push_str(&format!(
"update `config.toml` to use `change-id = {latest_config_id}` instead"
));
}
} else {
if &id == latest_config_id {
return None;
}

let change_links: Vec<String> = find_recent_config_change_ids(id)
.iter()
.map(|id| format!("https://github.com/rust-lang/rust/pull/{id}"))
.collect();
if !change_links.is_empty() {
msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
msg.push_str("To see more detail about these changes, visit the following PRs:\n");

for link in change_links {
msg.push_str(&format!(" - {link}\n"));
}

msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");

msg.push_str("note: to silence this warning, ");
msg.push_str(&format!(
"update `config.toml` to use `change-id = {latest_config_id}` instead"
));
}
} else {
msg.push_str("WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.\n");
msg.push_str("note: to silence this warning, ");
Expand Down

0 comments on commit e878100

Please sign in to comment.