From d9e8b6f3107ec72cc0e0884a285e17e1b7687177 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 23 2018 09:43:21 +0000 Subject: Introduce a new status: NEEDSREBASE This is returned when the PR doesn't conflict, isn't fast-forwardable (so needs a merge commit) but the project is configured to only allow fast-forward merge. Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/utils.py b/pagure/utils.py index 9e2b1dd..a523cda 100644 --- a/pagure/utils.py +++ b/pagure/utils.py @@ -624,8 +624,8 @@ def get_merge_options(request, merge_status): "message": "The pull-request can be merged with a merge commit", }, "MERGE-non-ff-bad": { - "code": "CONFLICTS", - "short_code": "Conflicts", + "code": "NEEDSREBASE", + "short_code": "Needs rebase", "message": "The pull-request must be rebased before merging", }, } diff --git a/tests/test_pagure_flask_internal.py b/tests/test_pagure_flask_internal.py index c9d19d0..29e9224 100644 --- a/tests/test_pagure_flask_internal.py +++ b/tests/test_pagure_flask_internal.py @@ -1132,9 +1132,9 @@ class PagureFlaskInternaltests(tests.Modeltests): output = self.app.post('/pv/pull-request/merge', data=data) self.assertEqual(output.status_code, 200) exp = { - "code": "CONFLICTS", + "code": "NEEDSREBASE", "message": "The pull-request must be rebased before merging", - "short_code": "Conflicts" + "short_code": "Needs rebase" } js_data = json.loads(output.get_data(as_text=True)) @@ -1148,9 +1148,9 @@ class PagureFlaskInternaltests(tests.Modeltests): output = self.app.post('/pv/pull-request/merge', data=data) self.assertEqual(output.status_code, 200) exp = { - "code": "CONFLICTS", + "code": "NEEDSREBASE", "message": "The pull-request must be rebased before merging", - "short_code": "Conflicts" + "short_code": "Needs rebase" } js_data = json.loads(output.get_data(as_text=True))