Also added a per-repository skip calculation flag.
repositories.add(model);\r
}\r
}\r
+ if (getBoolean(Keys.web.showRepositorySizes, true)) {\r
+ int repoCount = 0;\r
+ long startTime = System.currentTimeMillis();\r
+ ByteFormat byteFormat = new ByteFormat();\r
+ for (RepositoryModel model : repositories) {\r
+ if (!model.skipSizeCalculation) {\r
+ repoCount++;\r
+ model.size = byteFormat.format(calculateSize(model));\r
+ }\r
+ }\r
+ long duration = System.currentTimeMillis() - startTime;\r
+ logger.info(MessageFormat.format("{0} repository sizes calculated in {1} msecs",\r
+ repoCount, duration));\r
+ }\r
return repositories;\r
}\r
\r
model.showRemoteBranches = getConfig(config, "showRemoteBranches", false);\r
model.isFrozen = getConfig(config, "isFrozen", false);\r
model.showReadme = getConfig(config, "showReadme", false);\r
+ model.skipSizeCalculation = getConfig(config, "skipSizeCalculation", false);\r
model.federationStrategy = FederationStrategy.fromName(getConfig(config,\r
"federationStrategy", null));\r
model.federationSets = new ArrayList<String>(Arrays.asList(config.getStringList(\r
model.origin = config.getString("remote", "origin", "url");\r
}\r
r.close();\r
- if (getBoolean(Keys.web.showRepositorySizes, true)) {\r
- ByteFormat byteFormat = new ByteFormat();\r
- model.size = byteFormat.format(calculateSize(model)); \r
- }\r
return model;\r
}\r
\r
config.setBoolean("gitblit", null, "showRemoteBranches", repository.showRemoteBranches);\r
config.setBoolean("gitblit", null, "isFrozen", repository.isFrozen);\r
config.setBoolean("gitblit", null, "showReadme", repository.showReadme);\r
+ config.setBoolean("gitblit", null, "skipSizeCalculation", repository.skipSizeCalculation);\r
config.setStringList("gitblit", null, "federationSets", repository.federationSets);\r
config.setString("gitblit", null, "federationStrategy",\r
repository.federationStrategy.name());\r
\r
private JCheckBox showReadme;\r
\r
+ private JCheckBox skipSizeCalculation;\r
+\r
private JCheckBox isFrozen;\r
\r
private JComboBox accessRestriction;\r
anRepository.showRemoteBranches);\r
showReadme = new JCheckBox(Translation.get("gb.showReadmeDescription"),\r
anRepository.showReadme);\r
+ skipSizeCalculation = new JCheckBox(Translation.get("gb.skipSizeCalculationDescription"),\r
+ anRepository.skipSizeCalculation);\r
isFrozen = new JCheckBox(Translation.get("gb.isFrozenDescription"), anRepository.isFrozen);\r
\r
accessRestriction = new JComboBox(AccessRestrictionType.values());\r
fieldsPanel\r
.add(newFieldPanel(Translation.get("gb.showRemoteBranches"), showRemoteBranches));\r
fieldsPanel.add(newFieldPanel(Translation.get("gb.showReadme"), showReadme));\r
+ fieldsPanel.add(newFieldPanel(Translation.get("gb.skipSizeCalculation"), skipSizeCalculation));\r
fieldsPanel.add(newFieldPanel(Translation.get("gb.isFrozen"), isFrozen));\r
\r
usersPalette = new JPalette<String>();\r
repository.useDocs = useDocs.isSelected();\r
repository.showRemoteBranches = showRemoteBranches.isSelected();\r
repository.showReadme = showReadme.isSelected();\r
+ repository.skipSizeCalculation = skipSizeCalculation.isSelected();\r
repository.isFrozen = isFrozen.isSelected();\r
\r
repository.accessRestriction = (AccessRestrictionType) accessRestriction.getSelectedItem();\r
public FederationStrategy federationStrategy;\r
public List<String> federationSets;\r
public boolean isFederated;\r
+ public boolean skipSizeCalculation;\r
public String frequency;\r
public String origin;\r
public String size;\r
gb.general = general\r
gb.settings = settings\r
gb.manage = manage\r
-gb.lastLogin = last login
\ No newline at end of file
+gb.lastLogin = last login\r
+gb.skipSizeCalculation = skip size calculation\r
+gb.skipSizeCalculationDescription = do not calculate the repository size
\ No newline at end of file
<tr><th><wicket:message key="gb.enableDocs"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="useDocs" tabindex="6" /> <i><wicket:message key="gb.useDocsDescription"></wicket:message></i></td></tr>\r
<tr><th><wicket:message key="gb.showRemoteBranches"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="showRemoteBranches" tabindex="7" /> <i><wicket:message key="gb.showRemoteBranchesDescription"></wicket:message></i></td></tr>\r
<tr><th><wicket:message key="gb.showReadme"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="showReadme" tabindex="8" /> <i><wicket:message key="gb.showReadmeDescription"></wicket:message></i></td></tr>\r
- <tr><th><wicket:message key="gb.isFrozen"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="isFrozen" tabindex="9" /> <i><wicket:message key="gb.isFrozenDescription"></wicket:message></i></td></tr>\r
+ <tr><th><wicket:message key="gb.skipSizeCalculation"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="skipSizeCalculation" tabindex="9" /> <i><wicket:message key="gb.skipSizeCalculationDescription"></wicket:message></i></td></tr>\r
+ <tr><th><wicket:message key="gb.isFrozen"></wicket:message></th><td class="edit"><input type="checkbox" wicket:id="isFrozen" tabindex="10" /> <i><wicket:message key="gb.isFrozenDescription"></wicket:message></i></td></tr>\r
<tr><td colspan="2"><hr></hr></td></tr>\r
- <tr><th><wicket:message key="gb.accessRestriction"></wicket:message></th><td class="edit"><select class="span6" wicket:id="accessRestriction" tabindex="10" /></td></tr> \r
+ <tr><th><wicket:message key="gb.accessRestriction"></wicket:message></th><td class="edit"><select class="span6" wicket:id="accessRestriction" tabindex="11" /></td></tr> \r
<tr><th style="vertical-align: top;"><wicket:message key="gb.permittedUsers"></wicket:message></th><td style="padding:2px;"><span wicket:id="users"></span></td></tr>\r
<tr><td colspan="2"><hr></hr></td></tr> \r
- <tr><th><wicket:message key="gb.federationStrategy"></wicket:message></th><td class="edit"><select class="span6" wicket:id="federationStrategy" tabindex="11" /></td></tr>\r
+ <tr><th><wicket:message key="gb.federationStrategy"></wicket:message></th><td class="edit"><select class="span6" wicket:id="federationStrategy" tabindex="12" /></td></tr>\r
<tr><th style="vertical-align: top;"><wicket:message key="gb.federationSets"></wicket:message></th><td style="padding:2px;"><span wicket:id="federationSets"></span></td></tr>\r
- <tr><th></th><td class="editButton"><input class="btn" type="submit" value="Cancel" wicket:message="value:gb.cancel" wicket:id="cancel" tabindex="12" /> <input class="btn primary" type="submit" value="Save" wicket:message="value:gb.save" wicket:id="save" tabindex="13" /> </td></tr>\r
+ <tr><th></th><td class="editButton"><input class="btn" type="submit" value="Cancel" wicket:message="value:gb.cancel" wicket:id="cancel" tabindex="13" /> <input class="btn primary" type="submit" value="Save" wicket:message="value:gb.save" wicket:id="save" tabindex="14" /> </td></tr>\r
</tbody>\r
</table>\r
</form> \r
form.add(new CheckBox("useDocs"));\r
form.add(new CheckBox("showRemoteBranches"));\r
form.add(new CheckBox("showReadme"));\r
+ form.add(new CheckBox("skipSizeCalculation"));\r
form.add(usersPalette);\r
form.add(federationSetsPalette);\r
\r