Update description and error messages in review command

The description and error messages are outdated and are legacy of
the command originally being named "approve".

Change them to be more appropriate to the current usage of the
command, which is to apply reviews, which may or may not include
approvals, to patch sets.

Also rename the `approveOne` method to something more appropriate.

Change-Id: If95a24b8998bbac9a2ea410ecc05974674070e06
This commit is contained in:
David Pursehouse
2014-07-11 10:56:24 +09:00
committed by Edwin Kempin
parent 6f88c0d2ec
commit 77c055e618
2 changed files with 7 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ gerrit review
==============
== NAME
gerrit review - Verify, approve and/or submit one or more patch sets
gerrit review - Apply reviews to one or more patch sets
== SYNOPSIS
--

View File

@@ -56,7 +56,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
@CommandMetaData(name = "review", description = "Verify, approve and/or submit one or more patch sets")
@CommandMetaData(name = "review", description = "Apply reviews to one or more patch sets")
public class ReviewCommand extends SshCommand {
private static final Logger log =
LoggerFactory.getLogger(ReviewCommand.class);
@@ -163,7 +163,7 @@ public class ReviewCommand extends SshCommand {
boolean ok = true;
for (final PatchSet patchSet : patchSets) {
try {
approveOne(patchSet);
reviewPatchSet(patchSet);
} catch (UnloggedFailure e) {
ok = false;
writeError("error: " + e.getMessage() + "\n");
@@ -172,14 +172,14 @@ public class ReviewCommand extends SshCommand {
writeError("no such change " + patchSet.getId().getParentKey().get());
} catch (Exception e) {
ok = false;
writeError("fatal: internal server error while approving "
writeError("fatal: internal server error while reviewing "
+ patchSet.getId() + "\n");
log.error("internal error while approving " + patchSet.getId(), e);
log.error("internal error while reviewing " + patchSet.getId(), e);
}
}
if (!ok) {
throw new UnloggedFailure(1, "one or more approvals failed;"
throw new UnloggedFailure(1, "one or more reviews failed;"
+ " review output above");
}
}
@@ -192,7 +192,7 @@ public class ReviewCommand extends SshCommand {
.review(review);
}
private void approveOne(final PatchSet patchSet) throws Exception {
private void reviewPatchSet(final PatchSet patchSet) throws Exception {
if (changeComment == null) {
changeComment = "";