Is it possible to checkout only the directory structure in cvsclient in Java?
Asked Answered
C

2

7

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

Circumfluous answered 12/8, 2016 at 8:55 Comment(2)
What have you tried so far? Please show some code of yours. It's pretty hard to help with so little details about the actual programming.Abeokuta
I just added some codeCircumfluous
C
1

I found a command which is the RLogCommand that allowed me to get a list of all files on server with their revisions and info about them.

Circumfluous answered 6/9, 2016 at 11:54 Comment(0)
S
3

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("ls\n"));
client.processRequests(requests);
Safranine answered 29/8, 2016 at 18:26 Comment(0)
C
1

I found a command which is the RLogCommand that allowed me to get a list of all files on server with their revisions and info about them.

Circumfluous answered 6/9, 2016 at 11:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.