From 355cbb8f10527032e9c9cedbef5b68f118418d68 Mon Sep 17 00:00:00 2001 From: Florian Zschocke Date: Mon, 23 Jun 2014 04:12:19 +0200 Subject: [PATCH] Add merge type setting to repository page. The merge type is a per repository setting. Add it to the edit page. --- src/main/java/com/gitblit/wicket/GitBlitWebApp.properties | 2 ++ .../java/com/gitblit/wicket/pages/EditRepositoryPage.html | 3 ++- .../java/com/gitblit/wicket/pages/EditRepositoryPage.java | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties index a215b4d6..b3cbef82 100644 --- a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties @@ -660,6 +660,7 @@ gb.nTotalTickets = {0} total gb.body = body gb.mergeSha = mergeSha gb.mergeTo = merge to +gb.mergeType = merge type gb.labels = labels gb.reviewers = reviewers gb.voters = voters @@ -671,6 +672,7 @@ gb.repositoryDoesNotAcceptPatchsets = This repository does not accept patchsets. gb.serverDoesNotAcceptPatchsets = This server does not accept patchsets. gb.ticketIsClosed = This ticket is closed. gb.mergeToDescription = default integration branch for merging ticket patchsets +gb.mergeTypeDescription = merge a ticket fast-forward only, if necessary, or always with a merge commit to the integration branch gb.anonymousCanNotPropose = Anonymous users can not propose patchsets. gb.youDoNotHaveClonePermission = You are not permitted to clone this repository. gb.myTickets = my tickets diff --git a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html index 7a55b9f5..2c881efc 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html +++ b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html @@ -123,7 +123,8 @@
- +
+ diff --git a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java index 6bcf6f51..bf3eea8b 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -56,6 +56,7 @@ import com.gitblit.Constants.AccessRestrictionType; import com.gitblit.Constants.AuthorizationControl; import com.gitblit.Constants.CommitMessageRenderer; import com.gitblit.Constants.FederationStrategy; +import com.gitblit.Constants.MergeType; import com.gitblit.Constants.RegistrantType; import com.gitblit.GitBlitException; import com.gitblit.Keys; @@ -458,6 +459,11 @@ public class EditRepositoryPage extends RootSubPage { getString("gb.mergeToDescription"), new PropertyModel(repositoryModel, "mergeTo"), availableBranches)); + form.add(new ChoiceOption("mergeType", + getString("gb.mergeType"), + getString("gb.mergeTypeDescription"), + new PropertyModel(repositoryModel, "mergeType"), + Arrays.asList(MergeType.values()))); // // RECEIVE -- 2.39.5