Skip to content

Commit d836752

Browse files
authored
Show the cherry_picker command when backport failed (GH-30)
Closes python/miss-islington#29
1 parent 04431bf commit d836752

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

backport/tasks.py

+15-3
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,29 @@ def backport_task(commit_hash, branch, *, issue_number, created_by, merged_by):
3636
print(f"pwd: {os.pwd()}, listdir: {os.listdir('.')}")
3737
util.comment_on_pr(issue_number,
3838
f"""{util.get_participants(created_by, merged_by)}, Something is wrong... I can't backport for now.
39-
Please backport using [cherry_picker](https://pypi.org/project/cherry-picker/) on command line.""")
39+
Please backport using [cherry_picker](https://pypi.org/project/cherry-picker/) on command line.
40+
```
41+
cherry_picker {commit_hash} {branch}
42+
```
43+
""")
4044
cp = cherry_picker.CherryPicker('origin', commit_hash, [branch])
4145
try:
4246
cp.backport()
4347
except cherry_picker.BranchCheckoutException:
4448
util.comment_on_pr(issue_number,
4549
f"""Sorry {util.get_participants(created_by, merged_by)}, I had trouble checking out the `{branch}` backport branch.
46-
Please backport using [cherry_picker](https://pypi.org/project/cherry-picker/) on command line.""")
50+
Please backport using [cherry_picker](https://pypi.org/project/cherry-picker/) on command line.
51+
```
52+
cherry_picker {commit_hash} {branch}
53+
```
54+
""")
4755
cp.abort_cherry_pick()
4856
except cherry_picker.CherryPickException:
4957
util.comment_on_pr(issue_number,
5058
f"""Sorry, {util.get_participants(created_by, merged_by)}, I could not cleanly backport this to `{branch}` due to a conflict.
51-
Please backport using [cherry_picker](https://pypi.org/project/cherry-picker/) on command line.""")
59+
Please backport using [cherry_picker](https://pypi.org/project/cherry-picker/) on command line.
60+
```
61+
cherry_picker {commit_hash} {branch}
62+
```
63+
""")
5264
cp.abort_cherry_pick()

0 commit comments

Comments
 (0)