Merge branch 'stable-2.8'

* stable-2.8:
  Remove 'including replication' from the show-queue command description
  Add description for commands disabled in slave mode
  Remove unused import of Nio2ServiceFactory
This commit is contained in:
Shawn Pearce 2014-01-23 21:34:09 -08:00
commit dddc6368c6
4 changed files with 9 additions and 5 deletions

View File

@ -21,6 +21,7 @@ import com.google.gerrit.extensions.restapi.AuthException;
import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.account.CapabilityUtils;
import com.google.gerrit.server.args4j.SubcommandHandler;
import com.google.gerrit.sshd.commands.ErrorSlaveMode;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.assistedinject.Assisted;
@ -154,9 +155,13 @@ final class DispatchCommand extends BaseCommand {
String format = "%-" + maxLength + "s %s";
for (String name : Sets.newTreeSet(commands.keySet())) {
final CommandProvider p = commands.get(name);
Command c = p.getProvider().get();
String description = c instanceof ErrorSlaveMode
? "Command disabled: server is running in slave mode"
: Strings.nullToEmpty(p.getDescription());
usage.append(" ");
usage.append(String.format(format, name,
Strings.nullToEmpty(p.getDescription())));
usage.append(String.format(format, name, description));
usage.append("\n");
}
usage.append("\n");

View File

@ -65,7 +65,6 @@ import org.apache.sshd.common.io.IoServiceFactory;
import org.apache.sshd.common.io.IoSession;
import org.apache.sshd.common.io.mina.MinaServiceFactory;
import org.apache.sshd.common.io.mina.MinaSession;
import org.apache.sshd.common.io.nio2.Nio2ServiceFactory;
import org.apache.sshd.common.mac.HMACMD5;
import org.apache.sshd.common.mac.HMACMD596;
import org.apache.sshd.common.mac.HMACSHA1;

View File

@ -25,7 +25,7 @@ import java.io.IOException;
* server. This is used when a user tries to run a command on a server in Slave
* Mode, but the command only applies to the Master server.
*/
final class ErrorSlaveMode extends BaseCommand {
public final class ErrorSlaveMode extends BaseCommand {
@Override
public void start(final Environment env) {
String msg =

View File

@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
/** Display the current work queue. */
@AdminHighPriorityCommand
@CommandMetaData(name = "show-queue", description = "Display the background work queues, including replication")
@CommandMetaData(name = "show-queue", description = "Display the background work queues")
final class ShowQueue extends SshCommand {
@Option(name = "--wide", aliases = {"-w"}, usage = "display without line width truncation")
private boolean wide;