Add "aggressive" option to ssh command "GC"

When triggering a garbage collection through ssh it can be specified
whether to run an aggressive garbage collection or not.

Change-Id: Icfecc69915870289f5957912d3d53348f21a83f7
This commit is contained in:
Christian Halstrick 2015-03-11 15:14:40 +01:00
parent 2f94e2e562
commit 219f865fee
2 changed files with 9 additions and 1 deletions

View File

@ -8,6 +8,7 @@ gerrit gc - Run the Git garbage collection
'ssh' -p <port> <host> 'gerrit gc'
[--all]
[--show-progress]
[--aggressive]
<NAME> ...
--
@ -44,6 +45,9 @@ This command is intended to be used in scripts.
--show-progress::
If specified progress information is shown.
--aggressive::
If an aggressive garbage collection should be done.
== EXAMPLES
Run the Git garbage collection for the projects 'myProject' and

View File

@ -46,6 +46,9 @@ public class GarbageCollectionCommand extends SshCommand {
@Option(name = "--show-progress", usage = "progress information is shown")
private boolean showProgress;
@Option(name = "--aggressive", usage = "run aggressive garbage collection")
private boolean aggressive;
@Argument(index = 0, required = false, multiValued = true, metaVar = "NAME",
usage = "projects for which the Git garbage collection should be run")
private List<ProjectControl> projects = new ArrayList<>();
@ -85,7 +88,8 @@ public class GarbageCollectionCommand extends SshCommand {
}
GarbageCollectionResult result =
garbageCollectionFactory.create().run(projectNames, showProgress ? stdout : null);
garbageCollectionFactory.create().run(projectNames, aggressive,
showProgress ? stdout : null);
if (result.hasErrors()) {
for (GarbageCollectionResult.Error e : result.getErrors()) {
String msg;