Skip to content

Commit 16a4605

Browse files
committed
[update-checkout] Require --scheme for --match-timestamp.
Without a --scheme, --match-timestamp would only look back in time from the HEAD of each sibling repository which means those repositories will never go forward in time when the swift repo does. This is probably not what one wants when, for instance, bisecting and generally trying to do historical builds. Finding the --scheme behaviour in the first place is slightly non-obvious, passing that flag is easy to forget, and the non---scheme behaviour is probably not particularly useful, so let's just force --scheme to be passed. Fixes https://bugs.swift.org/browse/SR-7468 and rdar://problem/39520842
1 parent 59bcbb3 commit 16a4605

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

utils/update_checkout.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ def update_single_repository(args):
102102
checkout_target = find_rev_by_timestamp(timestamp,
103103
repo_name,
104104
checkout_target)
105-
elif timestamp:
106-
checkout_target = find_rev_by_timestamp(timestamp, repo_name,
107-
"HEAD")
108105

109106
# The clean option restores a repository to pristine condition.
110107
if should_clean:
@@ -435,10 +432,17 @@ def main():
435432
dest="n_processes")
436433
args = parser.parse_args()
437434

438-
if args.reset_to_remote and not args.scheme:
439-
print("update-checkout usage error: --reset-to-remote must specify "
440-
"--scheme=foo")
441-
sys.exit(1)
435+
if not args.scheme:
436+
if args.reset_to_remote:
437+
print("update-checkout usage error: --reset-to-remote must "
438+
"specify --scheme=foo")
439+
sys.exit(1)
440+
if args.match_timestamp:
441+
# without a scheme, we won't be able match timestamps forward in
442+
# time, which is an annoying footgun for bisection etc.
443+
print("update-checkout usage error: --match-timestamp must "
444+
"specify --scheme=foo")
445+
sys.exit(1)
442446

443447
clone = args.clone
444448
clone_with_ssh = args.clone_with_ssh

0 commit comments

Comments
 (0)