Bug 18884 - stcheckout should handle a convertCRLF flag
Summary: stcheckout should handle a convertCRLF flag
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Optional Tasks (show other bugs)
Version: 1.5.3
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: 1.6
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-09 22:11 UTC by Aaron DeForest
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments
patch to add requested feature plus documentation (3.83 KB, patch)
2003-04-22 02:18 UTC, Steve Cohen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron DeForest 2003-04-09 22:11:52 UTC
The stcheckout optional task should be able to checkout files without messing 
with the eol characters.

When you use this task to checkout Unix files onto an NT system, say, all of 
the files are in DOS format.  The fixcrlf task doesn't help me in this 
situation because some of my files are in binary format.

I looked in the StarTeamCheckout class and in StarTeam's API and I think all 
you have to do is something like ,...

add:
    private boolean convertCRLF = true;

    public void setConvertCRLF(boolean value) {
        this.convertCRLF = value;
    }

change line 533 (in 1.5.3 source) to:
                 !this.useRepositoryTimeStamp, this.convertCRLF, true);
Comment 1 Steve Cohen 2003-04-10 16:06:23 UTC
Are you saying that it is currently doing the conversion and you don't want it
to, or the reverse?
Comment 2 Aaron DeForest 2003-04-10 16:11:51 UTC
Currently when I checkout my repository to Windows, it is converting all of my 
Unix text files to DOS format.  For my builds, I need it to checkout without 
converting the eol character(s).

Thanks
Comment 3 Steve Cohen 2003-04-10 16:23:13 UTC
Looking at the source it looks as if the change you suggest could be made
relatively easily, according to the general plan you have laid out.  The one
tiny caveat is that the API documentation for starteam is not completely
consistent about what this flag means.  Compare their description of the eol
parameter in the checkout() method to their description of the same parameter in
the checkoutTo() method.  I am inclined to believe that it is simply an error in
their documentation, but I will want to test this.
Comment 4 Aaron DeForest 2003-04-10 22:09:46 UTC
You are right about the docs.  All of the checkout methods except checkout() 
have one definition while checkout() as a slightly different one.

If you want to put a fix into an optional.jar of v1.5.3 I can test it over here.
Comment 5 Aaron DeForest 2003-04-11 17:31:16 UTC
All right, I'm a spazz.  And I'm getting more pressure to use ant for the 
checkout.

I recompiled that class and used it with my test checkout script.  I used the 
fix I sent except mine defaults to false.  When convertCRLF=true, all my unix 
formatted files come out in dos format onto my NT build machine and when 
convertCRLF=false or it is not there, all my unix files come out in unix format 
onto my NT build machine.

Just thought I would let you know.

Thanks
Comment 6 Steve Cohen 2003-04-11 17:44:35 UTC
I will try to submit this as a patch this weekend.
Comment 7 Steve Cohen 2003-04-22 02:18:31 UTC
Created attachment 5937 [details]
patch to add requested feature plus documentation
Comment 8 Steve Cohen 2003-04-22 02:22:37 UTC
Submitted patch implements Mr. DeForest's request.  One difference - I call 
the option "convertEOL" instead of "convertCRLF" since it works in either 
direction and is more generic that way. 
  
Mr. DeForest - this will not reach the official distribution until 1.6 but it 
sounds like you have taken care of it on your own in the meantime. 
 
Comment 9 Stefan Bodewig 2003-05-02 08:21:07 UTC
Thanks, patch will be in nightly build 2003-05-03.