Make the code to format projects as a tree reusable

Move the code that prints a tree of nodes to the command line into an
own class so that it can be resused. At the moment it's only used to
format the project hierarchy as a tree. The motivation for this
refactoring is to reuse the logic for also formatting group member
hierarchies as a tree.

Change-Id: I535e0d68446a56b6cb6fa662f78a035a9c0a9294
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2011-11-16 10:55:58 +01:00
parent 8033dc204f
commit bb67cea821
5 changed files with 216 additions and 163 deletions

View File

@@ -39,6 +39,7 @@ import com.google.gerrit.sshd.args4j.PatchSetIdHandler;
import com.google.gerrit.sshd.args4j.ProjectControlHandler;
import com.google.gerrit.sshd.args4j.SocketAddressHandler;
import com.google.gerrit.sshd.commands.DefaultCommandModule;
import com.google.gerrit.sshd.commands.ProjectNode;
import com.google.gerrit.sshd.commands.QueryShell;
import com.google.gerrit.util.cli.CmdLineParser;
import com.google.gerrit.util.cli.OptionHandlerFactory;
@@ -80,6 +81,7 @@ public class SshModule extends FactoryModule {
bind(QueueProvider.class).to(CommandExecutorQueueProvider.class).in(SINGLETON);
bind(AccountManager.class);
factory(ChangeUserName.Factory.class);
factory(ProjectNode.Factory.class);
bind(PublickeyAuthenticator.class).to(DatabasePubKeyAuth.class);
bind(KeyPairProvider.class).toProvider(HostKeyProvider.class).in(SINGLETON);