Bug 21424

Summary: stcheckout task fails to obey "deleteuncontrolled attribute, leaves errant subdirectories in basedir
Product: Ant Reporter: Weiqi Gao <weiqigao>
Component: Optional SCM tasksAssignee: Ant Notifications List <notifications>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 1.5.3   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: I'm attaching my rejected patch here, just for the record.

Description Weiqi Gao 2003-07-09 00:14:40 UTC
I have observed some behavioral changed of the StarTeam checkout task 
stcheckout between Ant 1.5.1 and Ant 1.5.3.

I'm using the task this way:
  <target name="checkout">
    <stcheckout username="me"
            password="mysecret"
            url="myserver:49201/myproject/myproject"
            rootstarteamfolder="java"
            createworkingdirs="true"
            includes="*"
            excludes="*Src.jar"
            deleteuncontrolled="true"/>
  </target>

I switched from using Ant 1.5.1 to Ant 1.5.3 last week, and experienced 
two changes of behavior:

1. An empty set of working directories is created in the directory where 
I run the build.  Although the actual checked out files are in the 
correct place (the StarTeam default working folder as setup in the 
StarTeam GUI).

2. The stcheckout task doesn't seem to delete all the files that are NOT 
in StarTeam anymore, even though I have set deleteuncontolled to true.

Both were working properly in Ant 1.5.1 but not in 1.5.3.

We are using StarTeam 5.2.118 and the StarGate Runtime 5.2.  And Sun JDK 1.4.2.

I have tracked it down to this line of code in 
org.apache.tools.ant.tasfdef.optional.starteam.TreeBasedTask.getLocalRootMapping(Folder

starteamrootfolder):

localrootfolder = starteamrootfolder.getPathFragment();

On my system, this returns the final portion of my starteamrootfolder 
rather than the full path of the default working folder, which was what 
we want.

For my build file, I have
    starteamroolfolder="aaaa/bbbb/cccc"
and the localrootfolder gets set to "cccc" after this line.  It should probably
be set to "C:/myproject/aaaa/bbbb/cccc".
Comment 1 Antoine Levy-Lambert 2003-07-11 15:26:36 UTC
Could you download ant1.6alpha, including the source code, and check whether 
your problem still occurs with ant 1.6.
If your problem still occurs with ant 1.6, it would be useful if you could 
prepare a patch that could solve the issue.
Comment 2 Steve Cohen 2003-07-11 15:36:40 UTC
Antoine -
I am unaware of any code changes between 1.5.3 and 1.6 that would have changed
this behavior.
Comment 3 Weiqi Gao 2003-07-11 18:56:29 UTC
The behavior is still present in the 1.6alpha nightly from 2003-07-11.
Comment 4 Antoine Levy-Lambert 2003-07-11 19:24:27 UTC
this confirms what Steve Cohen wrote. Can you try to prepare a patch to solve 
this issue ? There are few committers who have the necessary environment 
(StarTeam) to do that. A patch against 1.6alpha would be the best, since there 
have been some recent formatting changes in the code. Antoine.
Comment 5 Steve Cohen 2003-07-11 19:31:23 UTC
Actually, Weiqi Gao did prepare a patch and submitted it via the list.  I
rejected it as being aimed at a point too deep in the code - its side effects
would have been much worse than this problem.  Basically, it would have broken
the task.  

I promised to take a look at it when time permits but I have very little time
now, unfortunately.  In a couple of weeks, I may have more opportunity.

Is there a release coming up soon?  Is that the reason for your push here, Antoine?
Comment 6 Weiqi Gao 2003-07-11 20:49:35 UTC
Created attachment 7259 [details]
I'm attaching my rejected patch here, just for the record.
Comment 7 Weiqi Gao 2003-09-19 18:11:03 UTC
Just a friendly ping to see how this issue with be dealt with in 1.6.
Comment 8 Antoine Levy-Lambert 2013-03-18 02:25:43 UTC
starteam ant tasks have been removed starting with Ant 1.8.0