@@ -171,6 +171,20 @@ def obtain_additional_swift_sources(
171
171
echo = False )
172
172
173
173
174
+ def dump_repo_hashes (config ):
175
+ max_len = reduce (lambda acc , x : max (acc , len (x )),
176
+ config ['repos' ].keys (), 0 )
177
+ fmt = "{:<%r}{}" % (max_len + 5 )
178
+ for repo_name , repo_info in sorted (config ['repos' ].items (),
179
+ key = lambda x : x [0 ]):
180
+ with shell .pushd (os .path .join (SWIFT_SOURCE_ROOT , repo_name ),
181
+ dry_run = False ,
182
+ echo = False ):
183
+ h = shell .capture (["git" , "log" , "--oneline" , "-n" , "1" ],
184
+ echo = False ).strip ()
185
+ print (fmt .format (repo_name , h ))
186
+
187
+
174
188
def validate_config (config ):
175
189
# Make sure that our branch-names are unique.
176
190
scheme_names = config ['branch-schemes' ].keys ()
@@ -241,7 +255,11 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""")
241
255
help = """Check out related pull requests referenced in the given
242
256
free-form GitHub-style comment.""" ,
243
257
metavar = 'GITHUB-COMMENT' ,
244
- dest = 'github_comment' )
258
+ dest = 'github_comment' ),
259
+ parser .add_argument (
260
+ '--dump-hashes' ,
261
+ action = 'store_true' ,
262
+ help = 'Dump the git hashes of all repositories being tracked' )
245
263
args = parser .parse_args ()
246
264
247
265
clone = args .clone
@@ -254,6 +272,10 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""")
254
272
config = json .load (f )
255
273
validate_config (config )
256
274
275
+ if args .dump_hashes :
276
+ dump_repo_hashes (config )
277
+ return 0
278
+
257
279
cross_repos_pr = {}
258
280
if github_comment :
259
281
regex_pr = r'(apple/[-a-zA-Z0-9_]+/pull/\d+|apple/[-a-zA-Z0-9_]+#\d+)'
0 commit comments