From 3acc4d434c43de3c46e33b4b67fec30a7057f76b Mon Sep 17 00:00:00 2001 From: Michal Konečný Date: Nov 18 2019 16:29:36 +0000 Subject: Improve comment on failure to create the git branches When user previously created a branch that already existed, he got comment on their issue, which wasn't much useful for him. This PR is making the comment more descriptive with telling the user what to do next. Fixes #19 Signed-off-by: Michal Konečný --- diff --git a/fedscm_admin/utils.py b/fedscm_admin/utils.py index 555fbb2..25f18ea 100644 --- a/fedscm_admin/utils.py +++ b/fedscm_admin/utils.py @@ -535,8 +535,16 @@ def prompt_for_new_branch(issue_json, issue_body_json, auto_approve=False): click.echo('- Checking if {0} already exists in PDC.'.format(branch_name)) pdc_branch = fedscm_admin.pdc.get_branch(repo, branch_name, branch_type) if pdc_branch: + ticket_text = \ + "The branch in PDC already exists, you can now create it yourself as follows:\n"\ + "Check in the project's settings if you have activated the git hook preventing"\ + "new git branches from being created and if you did, de-activate it.\n"\ + "Then simply run in cloned repository: "\ + "``git checkout -b && git push -u origin ``.\n"\ + "```` is the name of the branch you requested. \n"\ + "You only need to do this once and you can then use fedpkg as you normally do." prompt_to_close_bad_ticket( - issue_json, 'The branch in PDC already exists') + issue_json, ticket_text) return issue_id = issue_json['id']