ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Mitchell <>
Subject Re: *****spam***** Adding files to CVS with Ant
Date Tue, 07 Feb 2006 15:49:37 GMT
I had problems with this too.  I think what is happening is that it is 
trying to add your files in a directory called cvs-local/test-module, 
which doesn't exist in cvs, so it is failing, which is good, because 
this isn't what you want anyway.  If you were going to do this from the 
command line, you would "cd cvs-local/test-module" then run your cvs 
command from there.  My case is somewhat different, as my ${basedir} is 
checked out from my cvs repository.  It sounds like yours is not.   My  
problem ended up being that I was specifying full paths to the files to 
add,  and  I needed to instead make them relative to ${basedir}.  In 
your case, you  want  the  files you are adding to be relative to 
${cvs-local-dest}/${cvs-module}.  If I understand correctly, you should 
be able to do this by setting the dest attribute on the cvs task, e.g. 
"dest=${cvs-local-dest}/${cvs-module}", then exclude the path from the 
file name in your add command.  I'm not positive that this will work, 
but maybe it will give you some ideas of the direction to start looking in.

Giovanni Mesturini wrote:

>I have to add a file to CVS from client to server
>using an Ant script.
>This is my build.xml:
>	...
>	<property name="cvs-username" value="username" />
>	<property name="cvs-password" value="password" />
>	<property name="cvs-repository"
>	<property name="cvs-module" value="test-module"/>
>	<property name="cvs-local-dest" value="cvs-local"/>
>	<property name="file-to-be-added"
>	...
>	<target name="add-file">
>		<!-- Do a checkout first - IT WORKS -->
>		<cvs command="checkout" cvsRoot="${cvs-repository}"
>package="${cvs-module}" dest="${cvs-local-dest}"
>error="error.txt" output="output.txt"/>
>		<!-- Copy the files to be added in the directory
>just checked out - IT WORKS -->
>		<copy todir="${cvs-local-dest}/${cvs-module}">
>			<fileset dir=".">
>				<include name="${file-to-be-added}"/>
>			</fileset>
>		</copy>
>		<!-- Add the file just copied to repository - IT
>		<cvs command="add
>cvsRoot="${cvs-repository}" package="${cvs-module}"
>error="error.txt" output="output.txt"/>
>		<!-- Commit the add - IT DOES NOT WORK -->
>		<cvs command="commit
>cvsRoot="${cvs-repository}" package="${cvs-module}"
>error="error.txt" output="output.txt"/>
>	</target>
>	...
>Ant outputs:
>	Buildfile: build.xml
>	add-file:
>	Total time: 0 seconds
>But in "error.txt" file I find this message:
>	cvs add: in directory .:
>	cvs [add aborted]: there is no version here; do 'cvs
>checkout' first
>...and nothing is done: the file is missing on rep.
>Where I'm doing wrong?
>Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive 
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message