summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/client
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-03-08 15:39:36 -0500
committerJames Moger <james.moger@gitblit.com>2014-03-08 15:39:36 -0500
commitf1b8822f715ea00da6b7d39a8ea63864aeda2d39 (patch)
tree7346119f7339db023df9e4457cc840e645ee4303 /src/main/java/com/gitblit/client
parentea07809018ab5266e5568a63144a9998a3c95af8 (diff)
downloadgitblit-f1b8822f715ea00da6b7d39a8ea63864aeda2d39.tar.gz
gitblit-f1b8822f715ea00da6b7d39a8ea63864aeda2d39.zip
Allow configuring the default integration branch for a repository
Diffstat (limited to 'src/main/java/com/gitblit/client')
-rw-r--r--src/main/java/com/gitblit/client/EditRepositoryDialog.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/client/EditRepositoryDialog.java b/src/main/java/com/gitblit/client/EditRepositoryDialog.java
index c3690f37..ef665d10 100644
--- a/src/main/java/com/gitblit/client/EditRepositoryDialog.java
+++ b/src/main/java/com/gitblit/client/EditRepositoryDialog.java
@@ -58,6 +58,8 @@ import javax.swing.KeyStroke;
import javax.swing.ListCellRenderer;
import javax.swing.ScrollPaneConstants;
+import org.eclipse.jgit.lib.Repository;
+
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Constants.AuthorizationControl;
import com.gitblit.Constants.FederationStrategy;
@@ -92,7 +94,9 @@ public class EditRepositoryDialog extends JDialog {
private JCheckBox acceptNewTickets;
- private JCheckBox requireApproval;
+ private JCheckBox requireApproval;
+
+ private JComboBox mergeToField;
private JCheckBox useIncrementalPushTags;
@@ -217,6 +221,16 @@ public class EditRepositoryDialog extends JDialog {
anRepository.acceptNewPatchsets);
requireApproval = new JCheckBox(Translation.get("gb.requireApprovalDescription"),
anRepository.requireApproval);
+
+ if (ArrayUtils.isEmpty(anRepository.availableRefs)) {
+ mergeToField = new JComboBox();
+ mergeToField.setEnabled(false);
+ } else {
+ mergeToField = new JComboBox(
+ anRepository.availableRefs.toArray());
+ mergeToField.setSelectedItem(anRepository.mergeTo);
+ }
+
useIncrementalPushTags = new JCheckBox(Translation.get("gb.useIncrementalPushTagsDescription"),
anRepository.useIncrementalPushTags);
showRemoteBranches = new JCheckBox(
@@ -316,6 +330,7 @@ public class EditRepositoryDialog extends JDialog {
acceptNewPatchsets));
fieldsPanel.add(newFieldPanel(Translation.get("gb.requireApproval"),
requireApproval));
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.mergeTo"), mergeToField));
fieldsPanel
.add(newFieldPanel(Translation.get("gb.enableIncrementalPushTags"), useIncrementalPushTags));
fieldsPanel.add(newFieldPanel(Translation.get("gb.showRemoteBranches"),
@@ -573,6 +588,8 @@ public class EditRepositoryDialog extends JDialog {
repository.acceptNewPatchsets = acceptNewPatchsets.isSelected();
repository.acceptNewTickets = acceptNewTickets.isSelected();
repository.requireApproval = requireApproval.isSelected();
+ repository.mergeTo = mergeToField.getSelectedItem() == null ? null
+ : Repository.shortenRefName(mergeToField.getSelectedItem().toString());
repository.useIncrementalPushTags = useIncrementalPushTags.isSelected();
repository.showRemoteBranches = showRemoteBranches.isSelected();
repository.skipSizeCalculation = skipSizeCalculation.isSelected();