DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15995>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15995

cvstagdiff does not correctly handle the cvs comand with time formatted as 
"dd-MM-yy hh:mm:ss"

           Summary: cvstagdiff does not correctly handle the cvs comand with
                    time formatted as "dd-MM-yy hh:mm:ss"
           Product: Ant
           Version: 1.5.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The command passed by cvstagdiff to cvs when using the startdate and enddate 
attributes is incorrect when using a cvs date formatted as "dd-MM-yy hh:mm:ss". 
The command passed to cvs does not take into account the consequences of the 
space separating the two portions of the date/time value. The command passed to 
cvs is:

cvs rdiff -s -D 2003-01-10 12:15:19 -D 2003-01-10 14:50:31 <package>

when it should be:

cvs rdiff -s -D '2003-01-10 12:15:19' -D '2003-01-10 14:50:31' <package>

With the incorrect form of the command, cvs reports (via the ant log.xml file) 
that '12:15:19' '-D' '2003-01-10' and '14:50:31' are unknown module names.

One workaround is to add the quotes in the startdate and enddate attributes 
value in the build.xml, but this is clumsy and not really obvious:

<cvstagdiff startdate = "'2003-01-10 12:15:19'" ... etc

A better fix is to correct the code in CvsTagDiff.java (lines 309 to 313 - in 
the 'execute' method) from:

String rdiff = "rdiff -s " +
   (m_startTag != null ? ("-r " + m_startTag) : ("-D " + m_startDate))
    + " "
    + (m_endTag != null ? ("-r " + m_endTag) : ("-D " + m_endDate))
    + " " + m_package;

to:

String rdiff = "rdiff -s " +
   (m_startTag != null ? ("-r " + m_startTag) : ("-D '" + m_startDate + "'"))
    + " "
    + (m_endTag != null ? ("-r " + m_endTag) : ("-D '" + m_endDate + "'"))
    + " " + m_package;

I have tested this fix on a local build of Ant 1.5.1 (Windows 2000, Java 1.4) 
and the problem is cured. I'm not sure if this fix takes into account cvs 
running on different OSes.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to