Skip to content

Commit 36ab074

Browse files
committed
Push ci-overlays too in python-update-import
1 parent f2cc75f commit 36ab074

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -852,12 +852,12 @@ def update_import_cmd(args):
852852
repos_updated = []
853853

854854
# commit ci if dirty
855-
overlaytip = str(vc.tip(overlaydir)).strip()
856855
if vc.isDirty(overlaydir):
857856
vc.commit(overlaydir, "Update Python imports")
858-
overlaytip = str(vc.tip(overlaydir)).strip()
859857
repos_updated.append(overlaydir)
860858

859+
overlaytip = str(vc.tip(overlaydir)).strip()
860+
861861
# now allow dependent repos to hook into update
862862
output = mx.OutputCapture()
863863
for repo in repos:
@@ -869,21 +869,24 @@ def update_import_cmd(args):
869869
else:
870870
print(mx.colorize('%s command for %s.. skipped!' % (cmdname, basename), color='magenta', bright=True, stream=sys.stdout))
871871

872-
# update ci import in all our repos, commit the full update, and push verbosely
872+
# update ci import in all our repos, commit the full update
873873
prev_verbosity = mx._opts.very_verbose
874874
for repo in repos:
875875
jsonnetfile = os.path.join(repo, "ci.jsonnet")
876876
with open(jsonnetfile, "w") as f:
877877
f.write('{ "overlay": "%s" }\n' % overlaytip)
878878
if vc.isDirty(repo):
879879
vc.commit(repo, "Update imports")
880-
try:
881-
mx._opts.very_verbose = True
882-
vc.git_command(repo, ["push", "-u", "origin", "HEAD:%s" % current_branch], abortOnError=True)
883-
finally:
884-
mx._opts.very_verbose = prev_verbosity
885880
repos_updated.append(repo)
886881

882+
# push all repos
883+
for repo in repos_updated:
884+
try:
885+
mx._opts.very_verbose = True
886+
vc.git_command(repo, ["push", "-u", "origin", "HEAD:%s" % current_branch], abortOnError=True)
887+
finally:
888+
mx._opts.very_verbose = prev_verbosity
889+
887890
if repos_updated:
888891
mx.log("\n ".join(["These repos were updated:"] + repos_updated))
889892

0 commit comments

Comments
 (0)