@@ -27,22 +27,36 @@ enum Command {
27
27
/// Can be used to perform experimental pulls e.g. to test changes in the subtree repository
28
28
/// that have not yet been merged in `rust-lang/rust`.
29
29
#[ clap( long, default_value( DEFAULT_UPSTREAM_REPO ) ) ]
30
- upstream : String ,
30
+ upstream_repo : String ,
31
+
32
+ /// Path to the josh-sync TOML config file.
31
33
#[ clap( long, default_value( DEFAULT_CONFIG_PATH ) ) ]
32
34
config_path : PathBuf ,
35
+
36
+ /// Path to a file storing the last synchronized rustc commit.
33
37
#[ clap( long, default_value( DEFAULT_RUST_VERSION_PATH ) ) ]
34
38
rust_version_path : PathBuf ,
39
+
40
+ /// Override the rustc commit that we should pull from.
41
+ /// By default, josh-sync will pull from rustc's HEAD (latest commit).
42
+ #[ clap( long) ]
43
+ upstream_commit : Option < String > ,
35
44
} ,
36
45
/// Push changes into the main `rust-lang/rust` repository `branch` of a `rustc` fork under
37
46
/// the given GitHub `username`.
38
47
/// The pushed branch should then be merged into the `rustc` repository.
39
48
Push {
49
+ /// Path to the josh-sync TOML config file.
40
50
#[ clap( long, default_value( DEFAULT_CONFIG_PATH ) ) ]
41
51
config_path : PathBuf ,
52
+
53
+ /// Path to a file storing the last synchronized rustc commit.
42
54
#[ clap( long, default_value( DEFAULT_RUST_VERSION_PATH ) ) ]
43
55
rust_version_path : PathBuf ,
56
+
44
57
/// Branch that should be pushed to your remote
45
58
branch : String ,
59
+
46
60
/// Your GitHub usename where the fork is located
47
61
username : String ,
48
62
} ,
@@ -74,12 +88,13 @@ fn main() -> anyhow::Result<()> {
74
88
Command :: Pull {
75
89
config_path,
76
90
rust_version_path,
77
- upstream,
91
+ upstream_repo,
92
+ upstream_commit,
78
93
} => {
79
94
let ctx = load_context ( & config_path, & rust_version_path) ?;
80
95
let josh = get_josh_proxy ( ) ?;
81
96
let sync = GitSync :: new ( ctx. clone ( ) , josh) ;
82
- match sync. rustc_pull ( upstream ) {
97
+ match sync. rustc_pull ( upstream_repo , upstream_commit ) {
83
98
Ok ( result) => {
84
99
if !maybe_create_gh_pr (
85
100
& ctx. config . full_repo_name ( ) ,
0 commit comments