Bug 15995 - [PATCH] cvstagdiff does not correctly handle the cvs comand with time formatted as "dd-MM-yy hh:mm:ss"
Summary: [PATCH] cvstagdiff does not correctly handle the cvs comand with time formatt...
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: nightly
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: 1.6
Assignee: Ant Notifications List
URL:
Keywords:
: 24282 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-01-11 13:43 UTC by tony
Modified: 2008-02-22 12:18 UTC (History)
2 users (show)



Attachments
code patch (1.30 KB, patch)
2003-06-15 18:50 UTC, Rob van Oostrum
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tony 2003-01-11 13:43:57 UTC
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.
Comment 1 Rob van Oostrum 2003-06-15 18:50:05 UTC
Created attachment 6841 [details]
code patch
Comment 2 Rob van Oostrum 2003-06-15 18:52:04 UTC
Changed version to 1.6Alpha since that's where I fixed it.

Please verify this on the main trunk once the patch is committed. Don't know 
if we want to apply this to the 1.5.x branch as well.
Comment 3 Antoine Levy-Lambert 2003-06-15 19:41:56 UTC
patch submitted, thanks.
I do not know if and when there will be a new 1.5.x version. 
My understanding is that the next ant version will be ant 1.6
Comment 4 Stefan Bodewig 2003-11-03 15:11:02 UTC
*** Bug 24282 has been marked as a duplicate of this bug. ***