-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[utils][SR-2695] Tag checkout support for all repositories. #4892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thanks a lot for doing this.
I haven't heard from any other Swift committers since creating the starter task. I wonder if they have any thoughts on adding this flag? /cc @gottesmm
"--tag", | ||
help="""Check out each repository to the specified tag.""", | ||
metavar='TAG-NAME', | ||
dest='tag') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit-pick: This dest
parameter is unnecessary; since the argument name is --tag
the destination will automagically be named tag
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right, it's removed now.
'origin', repo_branch], echo=False) | ||
if not tag_exists: | ||
print("--- Skipping '" + repo_name + "' ---") | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice touch!! I love it.
@erg What do you think of this? |
0c173a9
to
7dc9997
Compare
Since @erg didn't respond, I'll review this real quick. This function is getting quite big. Can you split it into two functions? One for the tag and for the non-tag case? |
7dc9997
to
92e2623
Compare
Done! |
@swift-ci please Python lint |
@swift-ci Please Python lint |
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not what I was suggesting. I was suggesting that you keep 1 function but if you had the tag or scheme you delegated to different functions. It is just the middle section that should be refactored. Everything else is the same.
92e2623
to
ea58d5f
Compare
Oops, should be as you've suggested now. |
@aleksgapp No worries. Thanks for fixing this. @aleksgapp, @modocache. An additional question: I have not thought about this (and I am fine doing this in a follow on commit), but given that tag/scheme are exclusive options I wonder if there is a way to express them on the command line in an exclusive manner. Just doing something like --type=scheme --type=tag won't work since they require options. Maybe the thing to do is just make sure that only one is set and error otherwise? [Trying to steal a minute of your brain power = )] |
I guess we could use subparsers? Maybe have something like: ./update-checkout scheme Not sure. |
@gottesmm I had a quick look at this direction, but didn't include this to my initial implementation. There is an
One more thing that isn't fitting well here is optional arguments, e.g, I'm not sure if we need take care of those here? May be just adding an exclusiveness for |
@aleksgapp Yes, any such changes are 100% out of scope for this PR. Lets get this in. |
@swift-ci Please smoke test and merge |
ea58d5f
to
ed865fc
Compare
@@ -255,11 +287,15 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""") | |||
help="""Check out related pull requests referenced in the given | |||
free-form GitHub-style comment.""", | |||
metavar='GITHUB-COMMENT', | |||
dest='github_comment'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gottesmm Resolved small conflict, I believe this comma was a typo, right?
@swift-ci Please smoke test and merge |
1 similar comment
@swift-ci Please smoke test and merge |
Add support for a specific tag checkout for all repositories.
Resolves SR-2695.