From dab13a996adbfbc4086be6ff96836e590f7d339c Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 6 Dec 2012 17:15:05 -0500 Subject: [PATCH] Setting to stop a repository from contributing to the activity page --- src/com/gitblit/client/EditRepositoryDialog.java | 3 +-- src/com/gitblit/utils/ActivityUtils.java | 4 ++++ src/com/gitblit/wicket/GitBlitWebApp.properties | 3 ++- src/com/gitblit/wicket/pages/EditRepositoryPage.java | 6 ++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/com/gitblit/client/EditRepositoryDialog.java b/src/com/gitblit/client/EditRepositoryDialog.java index aa6ad58d..6f9ed525 100644 --- a/src/com/gitblit/client/EditRepositoryDialog.java +++ b/src/com/gitblit/client/EditRepositoryDialog.java @@ -227,10 +227,9 @@ public class EditRepositoryDialog extends JDialog { isFrozen = new JCheckBox(Translation.get("gb.isFrozenDescription"), anRepository.isFrozen); - maxActivityCommits = new JComboBox(new Integer [] { 0, 25, 50, 75, 100, 150, 250, 500 }); + maxActivityCommits = new JComboBox(new Integer [] { -1, 0, 25, 50, 75, 100, 150, 250, 500 }); maxActivityCommits.setSelectedItem(anRepository.maxActivityCommits); - mailingListsField = new JTextField( ArrayUtils.isEmpty(anRepository.mailingLists) ? "" : StringUtils.flattenStrings(anRepository.mailingLists, diff --git a/src/com/gitblit/utils/ActivityUtils.java b/src/com/gitblit/utils/ActivityUtils.java index 80aaebbb..ef3a55e7 100644 --- a/src/com/gitblit/utils/ActivityUtils.java +++ b/src/com/gitblit/utils/ActivityUtils.java @@ -81,6 +81,10 @@ public class ActivityUtils { Map activity = new HashMap(); for (RepositoryModel model : models) { + if (model.maxActivityCommits == -1) { + // skip this repository + continue; + } if (model.hasCommits && model.lastChange.after(thresholdDate)) { if (model.isCollectingGarbage) { continue; diff --git a/src/com/gitblit/wicket/GitBlitWebApp.properties b/src/com/gitblit/wicket/GitBlitWebApp.properties index 5b42a2c0..16f76411 100644 --- a/src/com/gitblit/wicket/GitBlitWebApp.properties +++ b/src/com/gitblit/wicket/GitBlitWebApp.properties @@ -439,4 +439,5 @@ gb.serveCertificate = serve https with this certificate gb.sslCertificateGeneratedRestart = Successfully generated new server SSL certificate for {0}.\nYou must restart Gitblit to use the new certificate.\n\nIf you are launching with the '--alias' parameter you will have to set that to ''--alias {0}''. gb.validity = validity gb.siteName = site name -gb.siteNameDescription = short, descriptive name of your server \ No newline at end of file +gb.siteNameDescription = short, descriptive name of your server +gb.excludeFromActivity = exclude from activity page \ No newline at end of file diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java index 7f66f688..a071b69e 100644 --- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -414,7 +414,7 @@ public class EditRepositoryPage extends RootSubPage { form.add(new CheckBox("showReadme")); form.add(new CheckBox("skipSizeCalculation")); form.add(new CheckBox("skipSummaryMetrics")); - List maxActivityCommits = Arrays.asList(0, 25, 50, 75, 100, 150, 200, 250, 500 ); + List maxActivityCommits = Arrays.asList(-1, 0, 25, 50, 75, 100, 150, 200, 250, 500 ); form.add(new DropDownChoice("maxActivityCommits", maxActivityCommits, new MaxActivityCommitsRenderer())); mailingLists = new Model(ArrayUtils.isEmpty(repositoryModel.mailingLists) ? "" @@ -666,7 +666,9 @@ public class EditRepositoryPage extends RootSubPage { @Override public String getDisplayValue(Integer value) { - if (value == 0) { + if (value == -1) { + return getString("gb.excludeFromActivity"); + } else if (value == 0) { return getString("gb.noMaximum"); } else { return value + " " + getString("gb.commits"); -- 2.39.5