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
Use “cvs checkout” giving the name of the directory in the cvs repository you want to checkout, where the name you give is a directory under CVSROOT, presently $CD_SOFT/cvs (eg app/alh, script). The directory you give, and all subdirectories, will be placed in your working directory.
The CVS repository stores a complete copy of all the files and directories which are under version control. Normally, you never access any of the files in the repository directly. Instead, you use CVS commands to get your own copy of the files into a working directory, and then work on that copy.
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);
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With