ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 15995] New: - cvstagdiff does not correctly handle the cvs comand with time formatted as "dd-MM-yy hh:mm:ss"
Date Sat, 11 Jan 2003 13:43:58 GMT
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: ant-dev@jakarta.apache.org
        ReportedBy: tony@bci.gb.com


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:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message