You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Simple Easy <ra...@yahoo.com> on 2008/06/26 10:25:59 UTC

stcheckout, unable to excludes directories

Hi,
 <stcheckout servername="${stserver}"
                serverport="${stport}"
                projectname="${stproject}"    
                rootstarteamfolder="${rootserver.dir}"
                viewname="${stview}"
                username="${stuser}"
                password="${stpassword}"
                createworkingdirs="true"
                recursive="true"
                rootlocalfolder="${build.dir}"                              
                forced="true"
                excludes="docs/*" />
It still checking out all the files in "docs" folder. 


      

RE: stcheckout, unable to excludes directories

Posted by "Burgess, Benjamin" <BB...@tiaa-cref.org>.
Purely looking at the task's code with no verifications or running it locally, I am pretty sure it was never meant to work with directories in the patterns.  In StarTeamCheckout.java, in the processFile method, at the top it has:

String filename = eachFile.getName();
File localFile = new File(targetFolder, filename);
if (!shouldProcess(filename)) {

but this will only compare the name of the file to the patterns, not the full repository path.

To change it to compare paths, you would instead change these lines to do this:

File localFile = new File(targetFolder, eachFile.getName());
if (!shouldProcess(getFullRepositoryPath(eachFile))) {

This should change it to use the whole path when comparing patterns without having any other affects on the task.  Also, the documentation doesn't make it extremely clear, but I am assuming that it is the repository path that patterns should be based off of as opposed to the local file system path.  In this case, the repository sometimes uses '/' and other times '\' for folder separators in the path.  Therefore, really the getFullRepositoryPath method in TreeBasedTask could be made to replace all '\' and '/' with File.seperator (to standardize what the server returns) and the matchPatterns method in the TreeBasedTask.java would need to be changed to use DirectoryScanner.matchPath instead of just DirectoryScanner.match - of course this would impact the other StarTeam tasks which could undergo similar enhancements.

Ben Burgess

-----Original Message-----
From: Simple Easy [mailto:random_simple_easy@yahoo.com] 
Sent: Thursday, June 26, 2008 4:26 AM
To: user@ant.apache.org
Subject: stcheckout, unable to excludes directories

Hi,
 <stcheckout servername="${stserver}"
                serverport="${stport}"
                projectname="${stproject}"    
                rootstarteamfolder="${rootserver.dir}"
                viewname="${stview}"
                username="${stuser}"
                password="${stpassword}"
                createworkingdirs="true"
                recursive="true"
                rootlocalfolder="${build.dir}"                              
                forced="true"
                excludes="docs/*" />
It still checking out all the files in "docs" folder. 


      

********************************************************************************************
This message, including any attachments, contains confidential information intended 
for a specific individual and purpose, and is protected by law. If you are not the intended 
recipient, please contact the sender immediately by reply e-mail and destroy all copies.
You are hereby notified that any disclosure, copying, or distribution of this message, or
the taking of any action based on it, is strictly prohibited.

TIAA-CREF
********************************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org