From 0e44acbb2fec928a1606dc60f427a148fff405c9 Mon Sep 17 00:00:00 2001
From: Mohamed Ragab <moragab@gmail.com>
Date: Wed, 02 May 2012 11:15:01 -0400
Subject: [PATCH] Added a script to facilitate setting the proxy host and port and no proxy hosts, and then it concatenates all the java system properties for setting the java proxy configurations and puts the resulting string in an environment variable JAVA_PROXY_CONFIG, modified the scirpts gitblit,  gitblit-ubuntu, and gitblit-centos to source the java-proxy-config.sh script and then include the resulting java proxy configuration in the java command

---
 src/com/gitblit/client/EditRepositoryDialog.java |   39 +++++++++++++++++++++++++++------------
 1 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/src/com/gitblit/client/EditRepositoryDialog.java b/src/com/gitblit/client/EditRepositoryDialog.java
index eaf7e0c..156de15 100644
--- a/src/com/gitblit/client/EditRepositoryDialog.java
+++ b/src/com/gitblit/client/EditRepositoryDialog.java
@@ -98,13 +98,15 @@
 
 	private JComboBox ownerField;
 
-	private JComboBox defaultHeadField;
+	private JComboBox headRefField;
 
 	private JPalette<String> usersPalette;
 
 	private JPalette<String> setsPalette;
 
 	private JPalette<String> teamsPalette;
+	
+	private JPalette<String> indexedBranchesPalette;
 
 	private JPalette<String> preReceivePalette;
 
@@ -158,13 +160,13 @@
 				anRepository.origin == null ? "" : anRepository.origin, 40);
 		originField.setEditable(false);
 
-		if (ArrayUtils.isEmpty(anRepository.availableHeads)) {
-			defaultHeadField = new JComboBox();
-			defaultHeadField.setEnabled(false);			
+		if (ArrayUtils.isEmpty(anRepository.availableRefs)) {
+			headRefField = new JComboBox();
+			headRefField.setEnabled(false);			
 		} else {
-			defaultHeadField = new JComboBox(
-					anRepository.availableHeads.toArray());
-			defaultHeadField.setSelectedItem(anRepository.defaultHead);
+			headRefField = new JComboBox(
+					anRepository.availableRefs.toArray());
+			headRefField.setSelectedItem(anRepository.HEAD);
 		}
 
 		ownerField = new JComboBox();
@@ -213,8 +215,7 @@
 				descriptionField));
 		fieldsPanel
 				.add(newFieldPanel(Translation.get("gb.origin"), originField));
-		fieldsPanel.add(newFieldPanel(Translation.get("gb.defaultHead"),
-				defaultHeadField));
+		fieldsPanel.add(newFieldPanel(Translation.get("gb.headRef"), headRefField));
 		fieldsPanel.add(newFieldPanel(Translation.get("gb.owner"), ownerField));
 
 		fieldsPanel.add(newFieldPanel(Translation.get("gb.enableTickets"),
@@ -259,6 +260,12 @@
 				.add(newFieldPanel(Translation.get("gb.federationSets"),
 						setsPalette), BorderLayout.CENTER);
 
+		indexedBranchesPalette = new JPalette<String>();
+		JPanel indexedBranchesPanel = new JPanel(new BorderLayout(5, 5));
+		indexedBranchesPanel
+				.add(newFieldPanel(Translation.get("gb.indexedBranches"),
+						indexedBranchesPalette), BorderLayout.CENTER);
+
 		preReceivePalette = new JPalette<String>(true);
 		preReceiveInherited = new JLabel();
 		JPanel preReceivePanel = new JPanel(new BorderLayout(5, 5));
@@ -278,6 +285,9 @@
 			panel.addTab(Translation.get("gb.teams"), teamsPanel);
 		}
 		panel.addTab(Translation.get("gb.federation"), federationPanel);
+		if (protocolVersion >= 3) {
+			panel.addTab(Translation.get("gb.indexedBranches"), indexedBranchesPanel);
+		}
 		panel.addTab(Translation.get("gb.preReceiveScripts"), preReceivePanel);
 		panel.addTab(Translation.get("gb.postReceiveScripts"), postReceivePanel);
 
@@ -404,8 +414,8 @@
 		repository.description = descriptionField.getText();
 		repository.owner = ownerField.getSelectedItem() == null ? null
 				: ownerField.getSelectedItem().toString();
-		repository.defaultHead = defaultHeadField.getSelectedItem() == null ? null
-				: defaultHeadField.getSelectedItem().toString();
+		repository.HEAD = headRefField.getSelectedItem() == null ? null
+				: headRefField.getSelectedItem().toString();
 		repository.useTickets = useTickets.isSelected();
 		repository.useDocs = useDocs.isSelected();
 		repository.showRemoteBranches = showRemoteBranches.isSelected();
@@ -434,7 +444,8 @@
 		if (repository.federationStrategy.exceeds(FederationStrategy.EXCLUDE)) {
 			repository.federationSets = setsPalette.getSelections();
 		}
-
+		
+		repository.indexedBranches = indexedBranchesPalette.getSelections();
 		repository.preReceiveScripts = preReceivePalette.getSelections();
 		repository.postReceiveScripts = postReceivePalette.getSelections();
 		return true;
@@ -471,6 +482,10 @@
 	public void setFederationSets(List<String> all, List<String> selected) {
 		setsPalette.setObjects(all, selected);
 	}
+	
+	public void setIndexedBranches(List<String> all, List<String> selected) {
+		indexedBranchesPalette.setObjects(all, selected);
+	}
 
 	public void setPreReceiveScripts(List<String> all, List<String> inherited,
 			List<String> selected) {

--
Gitblit v1.9.1