Skip to content

Commit 815365e

Browse files
authored
Merge pull request #16248 from huonw/match-timestamp-scheme
[update-checkout] Require --scheme for --match-timestamp.
2 parents 31db51d + 16a4605 commit 815365e

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)