@@ -32,7 +32,7 @@ sys.path.append(os.path.join(SCRIPT_DIR, 'swift_build_support'))
32
32
from swift_build_support import shell # noqa (E402)
33
33
34
34
35
- def update_working_copy (repo_path , branch ):
35
+ def update_single_repository (repo_path , branch ):
36
36
if not os .path .isdir (repo_path ):
37
37
return
38
38
@@ -56,6 +56,23 @@ def update_working_copy(repo_path, branch):
56
56
echo = False )
57
57
58
58
59
+ def update_all_repositories (args , config , branch ):
60
+ repo_branch = branch
61
+ for dir_name in config ["repositories" ].keys ():
62
+ if dir_name in args .skip_repository :
63
+ print ("--- Skipping '" + dir_name + "' ---" )
64
+ continue
65
+ if branch :
66
+ for config_branch_name in config ['branch-names' ]:
67
+ if branch not in config [config_branch_name ]['aliases' ]:
68
+ continue
69
+ repo_branch = config [config_branch_name ]['repos' ][dir_name ]
70
+ break
71
+
72
+ update_single_repository (os .path .join (SWIFT_SOURCE_ROOT , dir_name ),
73
+ repo_branch )
74
+
75
+
59
76
def obtain_additional_swift_sources (
60
77
config , with_ssh , branch , skip_history , skip_repositories ):
61
78
with shell .pushd (SWIFT_SOURCE_ROOT , dry_run = False ,
@@ -173,23 +190,9 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""")
173
190
obtain_additional_swift_sources (
174
191
config , clone_with_ssh , branch , skip_history , args .skip_repository )
175
192
176
- repo_branch = branch
177
- for dir_name in config ["repositories" ].keys ():
178
- if dir_name in args .skip_repository :
179
- print ("--- Skipping '" + dir_name + "' ---" )
180
- continue
181
- if branch :
182
- for config_branch_name in config ['branch-names' ]:
183
- if branch not in config [config_branch_name ]['aliases' ]:
184
- continue
185
- repo_branch = config [config_branch_name ]['repos' ][dir_name ]
186
- break
187
-
188
- update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , dir_name ),
189
- repo_branch )
193
+ update_all_repositories (args , config , branch )
190
194
191
195
return 0
192
196
193
-
194
197
if __name__ == "__main__" :
195
198
sys .exit (main ())
0 commit comments