Add --abort/--continue, --status, auto prefix commit msg with [X.Y]#68
Conversation
--abort: Do `git cherry-pick --abort` Clean up branch --continue Do `git commit -am "resolved" --allow-empty` Clean up branch Closes python#45
|
Backported this PR using the latest revision: python/cpython#1053 |
ncoghlan
left a comment
There was a problem hiding this comment.
This looks like a really nice refactoring & enhancement to me, just some minor questions/comments inline.
| def fetch_upstream(self): | ||
| """ git fetch <upstream> """ | ||
| # self.run_cmd(f"git fetch {self.upstream}") | ||
| pass |
There was a problem hiding this comment.
Is this still meant to be commented out?
There was a problem hiding this comment.
Thanks for the catch! 😅 Re-enabled this.
| click.echo(f" dry-run: Create new PR: {url}") | ||
| return | ||
| webbrowser.open_new_tab(url) | ||
| if '-' in cherry_pick_branch: |
There was a problem hiding this comment.
rpartition should allow this function to be simplified a bit: https://docs.python.org/3/library/stdtypes.html#str.rpartition
Specifically, I think it's just:
prefix, sep, base_branch = cherry_pick_branch.rpartition('-')
return base_branch
| :: | ||
|
|
||
| -- dry-run Dry Run Mode. Prints out the commands, but not executed. | ||
| -- push REMOTE Specify the branch to push into. Default is 'origin'. |
| subprocess_check_output.return_value = b'master' | ||
| assert get_current_branch() == 'master' | ||
|
|
||
| def test_sorted_branch(): |
There was a problem hiding this comment.
It would be handy to keep this test, either by splitting it out to a help function that's called by the property implementation, or else by testing cherry_picker.CherryPicker.sorted_branches.fget directly on a dummy object with a suitable branches attribute.
There was a problem hiding this comment.
Yes, I've been working on more tests. This is back in now. :)
Re-enable fetch from upstream more tests update readme
Lots of changes here:
--abortand--continueoptions(Described in (don't merge) Add --abort/--continue option to cherry_picker.py #65)
--statusoption, will do git status in the CPython dir[X.Y]#<PR-ID>withGH-<PR-ID>Closes #44
Closes #45