Is it possible to checkout only the directory structure in cvsclient in Java?
I am using the org-netbeans-lib-cvsclient.jar
to execute various cvs commands in a java class that communicates with CVS. I am able to do a cvs checkout command, add, commit, etc.
However, I need to find out which command is equivalent to the cvs ls -R
command.
Here is the code I wrote that allows to do a cvs check out:
CheckoutCommand command = new CheckoutCommand();
command.setBuilder(null);
command.setRecursive(true);
command.setModule(module);
if(revision!=null)
{
command.setCheckoutByRevision(revision);
}
command.setPruneDirectories(true);
command.setUseHeadIfNotFound(true);
executeCommand(command, AnonymizerConstants.DEFAULT_LOCAL_PATH);
I need to do something similar for CVS ls -R or CVS rls
There's no such command in this lib, but the good news are that you can write this command. You would basically need something like org.netbeans.lib.cvsclient.command.log.LogCommand
. The main method that you need is #execute
. This can be starting point:
List<Request> requests = new LinkedList<Request>();
requests.add(1, new ArgumentRequest("-R"));
requests.add(new CommandRequest("lsn"));
client.processRequests(requests);
我发现了一个命令,它是RLogCommand,它允许我获得服务器上所有文件的列表以及它们的修订版本和信息。
链接地址: http://www.djcxy.com/p/92902.html上一篇: 从两个数据框构建绘图时,ggplot传说