You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Frederic Lavigne <fr...@castify.net> on 2002/04/03 16:45:22 UTC
possible bug in ChangeLog task
Hi,
I've tested the changelog and found a possible bug in the log parser.
processGetPreviousRevision method sets the status to GET_COMMENT but it should set it to
GET_DATE otherwise the date information gets put in the comment and as the author is
escaped using a CDATA, you finally get a CDATA inside a CDATA...
Am I right ?
Here is the diff between my bug-fixed version and the current cvs version:
Index: ChangeLogParser.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java,v
retrieving revision 1.4
diff -c -r1.4 ChangeLogParser.java
*** ChangeLogParser.java 2 Apr 2002 08:42:44 -0000 1.4
--- ChangeLogParser.java 3 Apr 2002 14:39:39 -0000
***************
*** 255,261 ****
saveEntry();
m_revision = m_previousRevision;
! m_status = GET_COMMENT;
}
/**
--- 255,261 ----
saveEntry();
m_revision = m_previousRevision;
! m_status = GET_DATE;
}
/**
Also I've encountered some problems when cvs log is executed. The process hangs forever
and the changelog command never ends. I modified the Changelog command to send the cvs log
output to a temporary file (I reuse the cvs task for that) and then I pass this file to
the parser.
best,
-fred
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: possible bug in ChangeLog task
Posted by Peter Donald <pe...@apache.org>.
On Fri, 5 Apr 2002 16:37, Frederic Lavigne wrote:
> I've tested the latest version from cvs and the process still hangs. FYI, I
> tried with JDK1.2.2, 1.3.1 and 1.4 with the same result.
Wierd - try again - I just tried to fix this by having everything in separate
threads. See if that helps any.
> This is not a big issue for me, I will keep my patch for now. My patch
> consists of reusing the cvs task and redirecting the output to a temporary
> file. I've also added an "input" attribute to the cvschangelog task so I
> can first run a cvs task with more options (like -r, -s), then I pass this
> log to the cvschangelog task for processing.
>
> Anyway, I have a suggestion for the ChangeLog task. Maybe a Cvs task could
> be added as a member variable so the changelog can support advanced options
> for the 'cvs log' command.
I will have a look at it and see what can be done.
> I've attached the stylesheet I use to render the log in html ...
thanks! Added to ants CVS and added an example to the manual.
--
Cheers,
Pete
*--------------------------------------------------*
| Wise men don't need advice. Fools don't take it. |
| -Benjamin Franklin |
*--------------------------------------------------*
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: possible bug in ChangeLog task
Posted by Frederic Lavigne <fr...@castify.net>.
I've tested the latest version from cvs and the process still hangs. FYI, I tried with
JDK1.2.2, 1.3.1 and 1.4 with the same result.
This is not a big issue for me, I will keep my patch for now. My patch consists of reusing
the cvs task and redirecting the output to a temporary file. I've also added an "input"
attribute to the cvschangelog task so I can first run a cvs task with more options (like
-r, -s), then I pass this log to the cvschangelog task for processing.
Anyway, I have a suggestion for the ChangeLog task. Maybe a Cvs task could be added as a
member variable so the changelog can support advanced options for the 'cvs log' command.
I've attached the stylesheet I use to render the log in html which is inspired by the
netbeans changelog with the color scheme used by junitreport and jdepend. It expects three
parameters:
title : title of the page
module : name of the cvs module
cvsweb : url to cvsweb cgi to generate hyperlinks
Here is how I invoke it:
<style in="ChangeLog.xml" out="ChangeLog.html" style="netbeans-changelog.xsl">
<param name="title" expression="ChangeLog"/>
<param name="module" expression="testmodule"/>
<param name="cvsweb" expression="http://www:8000/cgi-bin/cvsweb/cvsweb.pl/"/>
</style>
Feel free to modify it, discard it, whatever.
thanks,
-fred
Peter Donald wrote:
> On Thu, 4 Apr 2002 00:45, Frederic Lavigne wrote:
>
>>I've tested the changelog and found a possible bug in the log parser.
>>processGetPreviousRevision method sets the status to GET_COMMENT but it
>>should set it to GET_DATE otherwise the date information gets put in the
>>comment
>>
>
> damn - fixed.
>
> I also fixed it so that the time is actually recorded now aswell - previously
> it was just reading the date and ignoring the time field ;)
>
>
>>and as the author is escaped using a CDATA, you finally get a CDATA
>>inside a CDATA...
>>
>
> I reworked this so that no matter what this should never happen by placing
> the CDATA escaping in the writer.
>
>
>>Am I right ?
>>
>
> completely! patch applied ;)
>
>
>>Also I've encountered some problems when cvs log is executed. The process
>>hangs forever and the changelog command never ends. I modified the
>>Changelog command to send the cvs log output to a temporary file (I reuse
>>the cvs task for that) and then I pass this file to the parser.
>>
>
> Can't reproduce but I suspect that it has something to do with the error
> stream not being read from until the end of parsing. Now the stderror is
> processed in a separate thread and this *should* fix it - if that was the
> problem. Could you download again and see if it works for you !
>
>
Re: possible bug in ChangeLog task
Posted by Peter Donald <pe...@apache.org>.
On Thu, 4 Apr 2002 00:45, Frederic Lavigne wrote:
> I've tested the changelog and found a possible bug in the log parser.
> processGetPreviousRevision method sets the status to GET_COMMENT but it
> should set it to GET_DATE otherwise the date information gets put in the
> comment
damn - fixed.
I also fixed it so that the time is actually recorded now aswell - previously
it was just reading the date and ignoring the time field ;)
> and as the author is escaped using a CDATA, you finally get a CDATA
> inside a CDATA...
I reworked this so that no matter what this should never happen by placing
the CDATA escaping in the writer.
> Am I right ?
completely! patch applied ;)
> Also I've encountered some problems when cvs log is executed. The process
> hangs forever and the changelog command never ends. I modified the
> Changelog command to send the cvs log output to a temporary file (I reuse
> the cvs task for that) and then I pass this file to the parser.
Can't reproduce but I suspect that it has something to do with the error
stream not being read from until the end of parsing. Now the stderror is
processed in a separate thread and this *should* fix it - if that was the
problem. Could you download again and see if it works for you !
--
Cheers,
Pete
-------------------------------------------------------
"When we remember we are all mad, the mysteries of life
disappear and life stands explained." -Mark Twain
-------------------------------------------------------
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>