<tr><th>Release</th><th>Protocol Version</th></tr>\r
<tr><td>Gitblit v0.7.0</td><td>1 (inferred version)</td></tr>\r
<tr><td>Gitblit v0.8.0</td><td>2</td></tr>\r
+<tr><td>Gitblit v0.9.0</td><td>3</td></tr>\r
</tbody>\r
</table>\r
\r
\r
private static final long serialVersionUID = 1L;\r
\r
- public static final int PROTOCOL_VERSION = 2;\r
+ public static final int PROTOCOL_VERSION = 3;\r
\r
public RpcServlet() {\r
super();\r
private JPalette<String> setsPalette;\r
\r
private JPalette<String> teamsPalette;\r
+ \r
+ private JPalette<String> indexedBranchesPalette;\r
\r
private JPalette<String> preReceivePalette;\r
\r
.add(newFieldPanel(Translation.get("gb.federationSets"),\r
setsPalette), BorderLayout.CENTER);\r
\r
+ indexedBranchesPalette = new JPalette<String>();\r
+ JPanel indexedBranchesPanel = new JPanel(new BorderLayout(5, 5));\r
+ indexedBranchesPanel\r
+ .add(newFieldPanel(Translation.get("gb.indexedBranches"),\r
+ indexedBranchesPalette), BorderLayout.CENTER);\r
+\r
preReceivePalette = new JPalette<String>(true);\r
preReceiveInherited = new JLabel();\r
JPanel preReceivePanel = new JPanel(new BorderLayout(5, 5));\r
panel.addTab(Translation.get("gb.teams"), teamsPanel);\r
}\r
panel.addTab(Translation.get("gb.federation"), federationPanel);\r
+ if (protocolVersion >= 3) {\r
+ panel.addTab(Translation.get("gb.indexedBranches"), indexedBranchesPanel);\r
+ }\r
panel.addTab(Translation.get("gb.preReceiveScripts"), preReceivePanel);\r
panel.addTab(Translation.get("gb.postReceiveScripts"), postReceivePanel);\r
\r
if (repository.federationStrategy.exceeds(FederationStrategy.EXCLUDE)) {\r
repository.federationSets = setsPalette.getSelections();\r
}\r
-\r
+ \r
+ repository.indexedBranches = indexedBranchesPalette.getSelections();\r
repository.preReceiveScripts = preReceivePalette.getSelections();\r
repository.postReceiveScripts = postReceivePalette.getSelections();\r
return true;\r
public void setFederationSets(List<String> all, List<String> selected) {\r
setsPalette.setObjects(all, selected);\r
}\r
+ \r
+ public void setIndexedBranches(List<String> all, List<String> selected) {\r
+ indexedBranchesPalette.setObjects(all, selected);\r
+ }\r
\r
public void setPreReceiveScripts(List<String> all, List<String> inherited,\r
List<String> selected) {\r
dialog.setTeams(gitblit.getTeamnames(), null);\r
dialog.setRepositories(gitblit.getRepositories());\r
dialog.setFederationSets(gitblit.getFederationSets(), null);\r
+ dialog.setIndexedBranches(new ArrayList<String>(), null);\r
dialog.setPreReceiveScripts(gitblit.getPreReceiveScriptsUnused(null),\r
gitblit.getPreReceiveScriptsInherited(null), null);\r
dialog.setPostReceiveScripts(gitblit.getPostReceiveScriptsUnused(null),\r
dialog.setTeams(gitblit.getTeamnames(), gitblit.getPermittedTeamnames(repository));\r
dialog.setRepositories(gitblit.getRepositories());\r
dialog.setFederationSets(gitblit.getFederationSets(), repository.federationSets);\r
+ dialog.setIndexedBranches(repository.getLocalBranches(), repository.indexedBranches);\r
dialog.setPreReceiveScripts(gitblit.getPreReceiveScriptsUnused(repository),\r
gitblit.getPreReceiveScriptsInherited(repository), repository.preReceiveScripts);\r
dialog.setPostReceiveScripts(gitblit.getPostReceiveScriptsUnused(repository),\r
\r
import com.gitblit.Constants.AccessRestrictionType;\r
import com.gitblit.Constants.FederationStrategy;\r
+import com.gitblit.utils.ArrayUtils;\r
import com.gitblit.utils.StringUtils;\r
\r
/**\r
this.federationSets = new ArrayList<String>();\r
this.federationStrategy = FederationStrategy.FEDERATE_THIS; \r
}\r
+ \r
+ public List<String> getLocalBranches() {\r
+ if (ArrayUtils.isEmpty(availableRefs)) {\r
+ return new ArrayList<String>();\r
+ }\r
+ List<String> localBranches = new ArrayList<String>();\r
+ for (String ref : availableRefs) {\r
+ if (ref.startsWith("refs/heads")) {\r
+ localBranches.add(ref);\r
+ }\r
+ }\r
+ return localBranches;\r
+ }\r
\r
@Override\r
public String toString() {\r
import org.apache.wicket.model.Model;\r
import org.apache.wicket.model.util.CollectionModel;\r
import org.apache.wicket.model.util.ListModel;\r
-import org.eclipse.jgit.lib.Constants;\r
\r
import com.gitblit.Constants.AccessRestrictionType;\r
import com.gitblit.Constants.FederationStrategy;\r
new StringChoiceRenderer(), 8, false);\r
\r
// indexed local branches palette\r
- List<String> allLocalBranches = new ArrayList<String>();\r
- if (!ArrayUtils.isEmpty(repositoryModel.availableRefs)) {\r
- for (String ref : repositoryModel.availableRefs) {\r
- if (ref.startsWith(Constants.R_HEADS)) {\r
- allLocalBranches.add(ref);\r
- }\r
- }\r
- }\r
+ List<String> allLocalBranches = repositoryModel.getLocalBranches();\r
+\r
final Palette<String> indexedBranchesPalette = new Palette<String>("indexedBranches", new ListModel<String>(\r
indexedBranches), new CollectionModel<String>(allLocalBranches),\r
new StringChoiceRenderer(), 8, false);\r