[Logo] JCVSForum - Community Support For JCVS Users and Developers
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
update not pulling new files  XML
Forum Index » JCVS Developers
Author Message

Joined: 09/02/2006 13:13:32
Messages: 1

I have a module checked out that I'm trying to update using the JCVSUpdate class provided in the tutorial. When I run it with the default command string that is in the tutorial, I am not getting new files that have been checked in by someone else.

I suspected that it had to do with the CVSEntryVector, but no amount of fiddling with either that or the command string seems to do the trick.

Any suggestions?



Joined: 05/06/2004 18:09:23
Messages: 367
Location: Bangkok

Is it possible that you have checked out a branch or a tag? If so, then you will not see updates to the main trunk.
[Email] [WWW]

I have the same problem, and I haven't checked out a branch or tag. If a file I already have is changed, I receive the new version, but if new files have been created, they are not "seen" by jCVS (I checked with the Eclipse CVS plugin, the new files are there...)

I am using SSH connection, if it helps. I'm attaching the code I'm using right now... (it's a modified version of the JCVSUpdate code)


private void instanceMain( String[] args ) throws Exception {

String passWord = "lab";
String module = "cvstest";

String localDirectory =
CVSCUtilities.stripFinalSeparator( JCVSConstants.ROOT_DIR ) + "/" + module;

File wdFile = new File( localDirectory );

// Open the project (local working directory)
CVSClient client = new CVSClient();
CVSProject project = new CVSProject( client );
project.openProject( wdFile );

System.err.println( "Project has been opened." );

// The password is not saved...
project.setPassword( passWord );

// I had to set this -- checked out with port 22, but on opening
// the project it fell back to 2401
project.setConnectionPort( CVSClient.DEFAULT_SSH_PORT );

project.setTempDirectory( JCVSConstants.TMP_DIR );

CVSRequest request = new CVSRequest();

// The "command spec" you see below, "update:a:EAUFP:ctdeou:",
// is fully documented in the CVSCommandSpec.html file
// in doc/manual/dev/ in the jCVS II distribution, as
String statusCommand = "update:a:EAUFP:deou:";
if ( !request.parseControlString( statusCommand ) ) {
System.err.println( "Could not parse command specification '" + statusCommand + "'" );

// We need to add the CVSEntrys that describe the files in
// our working directory.
CVSEntry rootEntry = project.getRootEntry();
System.err.println( "ROOT: " + rootEntry );

CVSEntryVector entries = new CVSEntryVector();
JCVSUtils.addProjectEntries( entries, rootEntry );
request.setEntries( entries );

request.setArguments( new CVSArgumentVector() ); // No arguments

// Once you are confident of the code, you can turn these off.
request.traceRequest = true;
request.traceResponse = true;
request.traceTCPData = true;
request.traceProcessing = true;

CVSTestUI ui = new CVSTestUI();
request.setUserInterface( ui );

CVSResponse response = new CVSResponse();

// NOTE That now we have a CVSProject to help us along. We
// will let the code there setup CVSClient and CVSRequest
// for us, relieving us of all of that work we had to do in
// the checkout code.
boolean reqOk = project.performCVSRequest( request, response );
if ( reqOk ) {
boolean respOk = project.processCVSResponse( request, response );
System.err.println( "respOk == " + respOk );
System.err.println( response.getResultText() );
} else {
System.err.println( "FAILED to perform cvs request." );

// NOTE, You MUST make a call to CVSProject.writeAdminFile() ANY
// time that you perform an operation that modifies the CVSEntrys
// in the project, including "update", "ci", and other commands.


} // main()

The output is as follows. File "arquivo11.txt" has been updated (and I had checked it out before). But there are two other files, "/outraraiz.txt" and "/dir1/x2.txt", which were ignored...

Note also that the module name (cvstest) appears twice in the path "D:\tmp\testjcvs\root\cvstest\cvstest\dir1\dir11\arquivo11.txt". Is this correct?

Project has been opened.
ROOT: [ ./,D/.//// ]
CVSEntry: ./cvstest/.project
CVSEntry: ./cvstest/raiz.txt
CVSEntry: ./cvstest/dir1/arquivo1.txt
CVSEntry: ./cvstest/dir1/arquivo2.txt
CVSEntry: ./cvstest/dir1/dir11/arquivo11.txt
Opening server '22@eolio.cit'...
log4j:WARN No appenders could be found for logger (com.sshtools.j2ssh.transport.cipher.SshCipherFactory).
log4j:WARN Please initialize the log4j system properly.
Negotiating cvs protocol...
Sending command request, 'update'...
Reading server response...
Updated existing local file 'D:\tmp\testjcvs\root\cvstest\cvstest\dir1\dir11\arquivo11.txt'.
Closing CVS server connection.
Command completed with 'ok' status.

** The command completed successfully.
respOk == true
U ./cvstest/dir1/dir11/arquivo11.txt


Even I am facing the same problem. We have tool which can update the versions of files from cvs in my local folder. But its failing to pull new files. Can anyone help me in resolving this?

Thanks in advance,


Joined: 05/06/2004 18:09:23
Messages: 367
Location: Bangkok

The only reasons for the cvsc package to fail to retrieve/update files (off the top of my head):

1) Your working directory has a sticky tag
2) Your system time is out of sync with the server
3) You are not setting the necessary options for the update command.
4) You are not sending the CVS entries to the server during your invocation.
[Email] [WWW]
Forum Index » JCVS Developers
Go to:   
Powered by JForum 2.1.9 © JForum Team