@@ -6,8 +6,10 @@ use std::process::exit;
6
6
7
7
use xshell:: { Shell , cmd} ;
8
8
9
- const JOSH_FILTER : & str = ":rev(2efebd2f0c03dabbe5c3ad7b4ebfbd99238d1fb2 :prefix=src/tools/clippy):/src/tools/clippy" ;
9
+ const JOSH_FILTER : & str = ":rev(53d3bc02ed90eba01c5dbc5b2d0c4cabb67ffb4d :prefix=src/tools/clippy):/src/tools/clippy" ;
10
10
const JOSH_PORT : & str = "42042" ;
11
+ const TOOLCHAIN_TOML : & str = "rust-toolchain.toml" ;
12
+ const UTILS_README : & str = "clippy_utils/README.md" ;
11
13
12
14
fn start_josh ( ) -> impl Drop {
13
15
// Create a wrapper that stops it on drop.
@@ -90,28 +92,37 @@ pub fn rustc_pull() {
90
92
const MERGE_COMMIT_MESSAGE : & str = "Merge from rustc" ;
91
93
92
94
let sh = Shell :: new ( ) . expect ( "failed to create shell" ) ;
93
- // sh.change_dir(clippy_project_root());
94
95
95
96
assert_clean_repo ( & sh) ;
96
97
97
98
// Update rust-toolchain file
98
99
let date = Utc :: now ( ) . format ( "%Y-%m-%d" ) . to_string ( ) ;
99
- let update = & mut update_text_region_fn (
100
+ let toolchain_update = & mut update_text_region_fn (
100
101
"# begin autogenerated nightly\n " ,
101
102
"# end autogenerated nightly" ,
102
103
|dst| {
103
104
writeln ! ( dst, "channel = \" nightly-{date}\" " ) . unwrap ( ) ;
104
105
} ,
105
106
) ;
107
+ let readme_update = & mut update_text_region_fn (
108
+ "<!-- begin autogenerated nightly -->\n " ,
109
+ "<!-- end autogenerated nightly -->" ,
110
+ |dst| {
111
+ writeln ! ( dst, "```\n nightly-{date}\n ```" ) . unwrap ( ) ;
112
+ } ,
113
+ ) ;
106
114
107
115
let mut updater = FileUpdater :: default ( ) ;
108
- updater. update_file ( "rust-toolchain.toml" , update ) ;
109
- updater. update_file ( "clippy_utils/README.md" , update ) ;
116
+ updater. update_file ( TOOLCHAIN_TOML , toolchain_update ) ;
117
+ updater. update_file ( UTILS_README , readme_update ) ;
110
118
111
119
let message = format ! ( "Bump nightly version -> {date}" ) ;
112
- cmd ! ( sh, "git commit rust-toolchain --no-verify -m {message}" )
113
- . run ( )
114
- . expect ( "FAILED to commit rust-toolchain file, something went wrong" ) ;
120
+ cmd ! (
121
+ sh,
122
+ "git commit --no-verify -m {message} -- {TOOLCHAIN_TOML} {UTILS_README}"
123
+ )
124
+ . run ( )
125
+ . expect ( "FAILED to commit rust-toolchain.toml file, something went wrong" ) ;
115
126
116
127
let commit = rustc_hash ( ) ;
117
128
@@ -160,7 +171,6 @@ pub(crate) const PUSH_PR_DESCRIPTION: &str = "Sync from Clippy commit:";
160
171
161
172
pub fn rustc_push ( rustc_path : String , github_user : & str , branch : & str , force : bool ) {
162
173
let sh = Shell :: new ( ) . expect ( "failed to create shell" ) ;
163
- // sh.change_dir(clippy_project_root());
164
174
165
175
assert_clean_repo ( & sh) ;
166
176
@@ -200,7 +210,6 @@ pub fn rustc_push(rustc_path: String, github_user: &str, branch: &str, force: bo
200
210
let _josh = start_josh ( ) ;
201
211
202
212
// Do the actual push.
203
- // sh.change_dir(clippy_project_root());
204
213
println ! ( "Pushing Clippy changes..." ) ;
205
214
cmd ! (
206
215
sh,
0 commit comments