From 90fc5ac5dbe6d5093525ab55c8d81c8277121550 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 | 4 +++- .../java/com/gitblit/wicket/pages/EditRepositoryPage.html | 3 ++- .../java/com/gitblit/wicket/pages/EditRepositoryPage.java | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties index eb92e2d2..eefebcca 100644 --- a/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/main/java/com/gitblit/wicket/GitBlitWebApp.properties @@ -659,6 +659,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 @@ -670,6 +671,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 @@ -741,4 +743,4 @@ gb.sshKeyCommentDescription = Enter an optional comment. If blank, the comment w gb.permission = Permission gb.sshKeyPermissionDescription = Specify the access permission for the SSH key gb.transportPreference = Transport Preference -gb.transportPreferenceDescription = Set the transport that you prefer to use for cloning \ No newline at end of file +gb.transportPreferenceDescription = Set the transport that you prefer to use for cloning diff --git a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html index 1e683b4f..e7fa601f 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html +++ b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.html @@ -122,7 +122,8 @@
- +
+ diff --git a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java index b5c46ac2..a13c481a 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