[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 
cvsc update command  XML
Forum Index » JCVS Developers
Author Message
belxanthian



Joined: 20/11/2004 19:22:46
Messages: 1
Offline

I am trying to perform an update on an existing project that I have checked out.
When I do an update the project updates all files reguardless if I have changed
them in the repository or not. Also it always downloads the CVSROOT even though
that directory was not requested in the project. Can you please look at my code
and tell me what I may be doing wrong? I just want changed files from the
project Dynocal5:

My Code:

private void update()
{

String scrambled = CVSScramble.scramblePassword( new String(
cvsRepository_.getCredentials().getUserPassword() ), 'A' );

cvsClient_ = new CVSClient( cvsRepository_.getHost(),
cvsRepository_.getPort() );

CVSProject project = new CVSProject( this.cvsClient_ );
project.setTempDirectory(
globalOptions_.getDynocalDirectories().getTemporaryDirectory() );

project.setAllowsGzipFileMode( true );

project.setGzipStreamLevel( 0 );

try
{
project.openProject( new File( rootDirectory_ ) );

project.setConnectionPort( cvsRepository_.getPort() );
project.getClient().setPort( cvsRepository_.getPort() );

project.setServerCommand( "(Not Applicable)" );

// project.setSetVariables (
CVSUtilities.getUserSetVariables( project.getClient().getHostName() ) );

project.setPassword( scrambled );

}
catch (IOException ex )
{

}

CVSEntryVector entries = new CVSEntryVector();

this.cvsRequest_ = new CVSRequest();

String checkOutCommand = "update:A:EAUPM:deou:-d"; //
"update:p:AEUX:deou:-d";

cvsRequest_.parseControlString( checkOutCommand );
project.setUserName( cvsRepository_.getCredentials().getUserName()
);

project.readEntries();

entries = project.getRootEntry().getEntryList(); //
addAllSubTreeEntries( entries );

project.setConnectionPort( cvsRepository_.getPort() );
project.setConnectionMethod( CVSRequest.METHOD_INETD );
project.setServerCommand( "(not applicable)" );

project.setAllowsGzipFileMode( false );

project.setGzipStreamLevel( 0 );

project.setPassword( scrambled );
cvsRequest_.setPServer( true );
cvsRequest_.setUserName(
cvsRepository_.getCredentials().getUserName() );

cvsRequest_.setPassword( project.getPassword() );

cvsRequest_.setConnectionMethod( CVSRequest.METHOD_INETD );
cvsRequest_.setServerCommand( project.getServerCommand() );

cvsRequest_.setPort( cvsRepository_.getPort() );
cvsRequest_.setHostName( cvsClient_.getHostName() );

cvsRequest_.setRepository( cvsRepository_.getModule() );
cvsRequest_.setRootDirectory( cvsRepository_.getRepository() );
cvsRequest_.setRootRepository( cvsRepository_.getRepository() );
cvsRequest_.setLocalDirectory( rootDirectory_ );

cvsRequest_.setSetVariables( project.getSetVariables() );

cvsRequest_.responseHandler = project;

cvsRequest_.traceRequest = CVSProject.overTraceRequest;
cvsRequest_.traceResponse = CVSProject.overTraceResponse;
cvsRequest_.traceTCPData = CVSProject.overTraceTCP;
cvsRequest_.traceProcessing = CVSProject.overTraceProcessing;

cvsRequest_.allowGzipFileMode = project.allowsGzipFileMode();
cvsRequest_.setGzipStreamLevel( project.getGzipStreamLevel() );

cvsRequest_.setEntries( entries );
cvsRequest_.setUserInterface( this );
CVSResponse response = new CVSResponse();

CVSThread thread = new CVSThread( "CheckOut", this.new
CheckoutRunner( project, this.cvsClient_, cvsRequest_, response, false ),
this.new CheckoutMonitor( cvsRequest_, response, false ) );

thread.start();

}

This is my checkout command that works

private void checkout()
{

String scrambled = CVSScramble.scramblePassword( new String(
cvsRepository_.getCredentials().getUserPassword() ), 'A' );

cvsClient_ = new CVSClient( cvsRepository_.getHost(),
cvsRepository_.getPort() );

CVSEntryVector entries = new CVSEntryVector();
CVSArgumentVector arguments = CVSArgumentVector.parseArgumentString(
"Dynocal5" );
this.cvsRequest_ = new CVSRequest();

String checkOutCommand = ":co:N:ANP:deou:";

cvsRequest_.parseControlString( checkOutCommand );

CVSProject project = new CVSProject( this.cvsClient_ );

CVSProjectDef projectDef = new CVSProjectDef(
CVSRequest.METHOD_INETD, true, false, cvsRepository_.getHost(),
cvsRepository_.getCredentials().getUserName(), cvsRepository_.getRepository(),
cvsRepository_.getModule() );

project.setProjectDef( projectDef );

project.setUserName( cvsRepository_.getCredentials().getUserName()
);

project.setTempDirectory(
globalOptions_.getDynocalDirectories().getTemporaryDirectory() );
project.setRepository( cvsRepository_.getModule() );
project.setRootDirectory( cvsRepository_.getRepository() );
project.setLocalRootDirectory( rootDirectory_ );
project.setPServer( true );

project.setConnectionPort( cvsRepository_.getPort() );
project.setConnectionMethod( CVSRequest.METHOD_INETD );

// project.setSetVariables( CVSUtilities.getUserSetVariables( hostname ) );

project.setServerCommand( "(not applicable)" );

project.setAllowsGzipFileMode( false );

project.setGzipStreamLevel( 0 );

project.setPassword( scrambled );

// Finally, we must make sure that the Project has its root entry, as
// CVSProject will not be able to create it from the context that the
// server will send with the checkout.

project.establishRootEntry( cvsRepository_.getRepository() );

// NOTE that all of these redundant setters on request are
// needed because we are not using the typicall call to
// CVSProject.performCVSCommand(), which calls most of
// these setters for us.

cvsRequest_.setPServer( true );
cvsRequest_.setUserName(
cvsRepository_.getCredentials().getUserName() );

cvsRequest_.setPassword( project.getPassword() );

cvsRequest_.setConnectionMethod( CVSRequest.METHOD_INETD );
cvsRequest_.setServerCommand( project.getServerCommand() );
cvsRequest_.setRshProcess( project.getRshProcess() );

cvsRequest_.setPort( cvsRepository_.getPort() );
cvsRequest_.setHostName( cvsClient_.getHostName() );

cvsRequest_.setRepository( cvsRepository_.getModule() );
cvsRequest_.setRootDirectory( cvsRepository_.getRepository() );
cvsRequest_.setRootRepository( cvsRepository_.getRepository() );
cvsRequest_.setLocalDirectory( rootDirectory_ );

cvsRequest_.setSetVariables( project.getSetVariables() );

cvsRequest_.responseHandler = project;

cvsRequest_.traceRequest = CVSProject.overTraceRequest;
cvsRequest_.traceResponse = CVSProject.overTraceResponse;
cvsRequest_.traceTCPData = CVSProject.overTraceTCP;
cvsRequest_.traceProcessing = CVSProject.overTraceProcessing;

cvsRequest_.allowGzipFileMode = project.allowsGzipFileMode();
cvsRequest_.setGzipStreamLevel( project.getGzipStreamLevel() );

cvsRequest_.setEntries( entries );

cvsRequest_.appendArguments( arguments );

cvsRequest_.setUserInterface( this );

CVSResponse response = new CVSResponse();

CVSThread thread = new CVSThread( "CheckOut", this.new
CheckoutRunner( project, this.cvsClient_, cvsRequest_, response, false ),
this.new CheckoutMonitor( cvsRequest_, response, false ) );

thread.start();

}


Also this is my modules file

Core Core
Options Options
Dynocal5 -a Core Options


All I want is the Core and Options directory to be updated with any file that is
changed on the repository.


Thanks for your help.
Jeff
[Email]
time


[Avatar]

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

The only thing that I notice right off is that your command spec does not match
the default for the jCVS II application. You are using "update:A:EAUPM:deou:-d"
Could you please try changing the command spec to the following:

update:A:EAUFP:deou:

and let me know if this changes anything?

The critical thing is the "F" which tells the command to send the file names of
the entries as arguments to the command.
[Email] [WWW]
 
Forum Index » JCVS Developers
Go to:   
Powered by JForum 2.1.9 © JForum Team