git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@705646 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -473,6 +473,10 @@ Other changes: | |||||
| work against a remote repository without any working copy. | work against a remote repository without any working copy. | ||||
| Bugzilla Report 27419. | Bugzilla Report 27419. | ||||
| * start and end tags can now be used instead of dates in | |||||
| <cvschangelog>. | |||||
| Bugzilla Report 27419. | |||||
| Changes from Ant 1.7.0 TO Ant 1.7.1 | Changes from Ant 1.7.0 TO Ant 1.7.1 | ||||
| ============================================= | ============================================= | ||||
| @@ -132,6 +132,23 @@ operation may fail when using such an incompatible client. | |||||
| false. <em>Since Ant 1.8.0</em></td> | false. <em>Since Ant 1.8.0</em></td> | ||||
| <td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
| </tr> | </tr> | ||||
| <tr> | |||||
| <td valign="top">startTag</td> | |||||
| <td valign="top">The start of a tag range. If endTag is also | |||||
| specified, they must both be on the same branch. If endTag is not | |||||
| specified, the end of the range will be the latest on the same | |||||
| branch on which startTag lives. <em>Since Ant 1.8.0</em></td> | |||||
| <td align="center" valign="top">No</td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td valign="top">endTag</td> | |||||
| <td valign="top">The end of a tag range. If startTag is also | |||||
| specified, they must both be on the same branch. If startTag is | |||||
| not specified, the start of the range will be the top of the | |||||
| branch on which endTag lives.</td> included in the report. | |||||
| <em>Since Ant 1.8.0</em></td> | |||||
| <td align="center" valign="top">No</td> | |||||
| </tr> | |||||
| </table> | </table> | ||||
| <h3>Parameters specified as nested elements</h3> | <h3>Parameters specified as nested elements</h3> | ||||
| @@ -98,6 +98,11 @@ public class ChangeLogTask extends AbstractCvsTask { | |||||
| /** Determines whether log (false) or rlog (true) is used */ | /** Determines whether log (false) or rlog (true) is used */ | ||||
| private boolean remote = false; | private boolean remote = false; | ||||
| /** Start tag when doing tag ranges. */ | |||||
| private String startTag; | |||||
| /** End tag when doing tag ranges. */ | |||||
| private String endTag; | |||||
| /** | /** | ||||
| * Filesets containing list of files against which the cvs log will be | * Filesets containing list of files against which the cvs log will be | ||||
| @@ -191,6 +196,25 @@ public class ChangeLogTask extends AbstractCvsTask { | |||||
| this.remote = remote; | this.remote = remote; | ||||
| } | } | ||||
| /** | |||||
| * Set the tag at which the changelog should start. | |||||
| * | |||||
| * @param start The date at which the changelog should start. | |||||
| */ | |||||
| public void setStartTag(final String start) { | |||||
| this.startTag = start; | |||||
| } | |||||
| /** | |||||
| * Set the tag at which the changelog should stop. | |||||
| * | |||||
| * @param end The date at which the changelog should stop. | |||||
| */ | |||||
| public void setEndTag(final String end) { | |||||
| this.endTag = end; | |||||
| } | |||||
| /** | /** | ||||
| * Adds a set of files about which cvs logs will be generated. | * Adds a set of files about which cvs logs will be generated. | ||||
| * | * | ||||
| @@ -250,7 +274,12 @@ public class ChangeLogTask extends AbstractCvsTask { | |||||
| // parse. | // parse. | ||||
| addCommandArgument("-N"); | addCommandArgument("-N"); | ||||
| } | } | ||||
| if (null != startDate) { | |||||
| if (null != startTag || null != endTag) { | |||||
| // man, do I get spoiled by C#'s ?? operator | |||||
| String startValue = startTag == null ? "" : startTag; | |||||
| String endValue = endTag == null ? "" : endTag; | |||||
| addCommandArgument("-r" + startValue + "::" + endValue); | |||||
| } else if (null != startDate) { | |||||
| final SimpleDateFormat outputDate = | final SimpleDateFormat outputDate = | ||||
| new SimpleDateFormat("yyyy-MM-dd"); | new SimpleDateFormat("yyyy-MM-dd"); | ||||
| @@ -336,6 +365,12 @@ public class ChangeLogTask extends AbstractCvsTask { | |||||
| throw new BuildException(message); | throw new BuildException(message); | ||||
| } | } | ||||
| if ((null != startTag || null != endTag) | |||||
| && (null != startDate || null != endDate)) { | |||||
| final String message = "Specify either a tag or date range," | |||||
| + " not both"; | |||||
| throw new BuildException(message); | |||||
| } | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -60,6 +60,75 @@ | |||||
| value="[yet another test.txt]"/> | value="[yet another test.txt]"/> | ||||
| </target> | </target> | ||||
| <target name="xtestRemoteChangelogStartTag"> | |||||
| <mkdir dir="${output}"/> | |||||
| <cvschangelog cvsroot="${cvsroot}" | |||||
| remote="true" startTag="testtag1" | |||||
| destfile="${output}/report.xml"> | |||||
| <module name="antmodule3"/> | |||||
| </cvschangelog> | |||||
| <au:assertFileExists file="${output}/report.xml"/> | |||||
| <au:assertResourceContains resource="${output}/report.xml" | |||||
| value="[yet another test.txt]"/> | |||||
| </target> | |||||
| <target name="testRemoteChangelogEndTag"> | |||||
| <mkdir dir="${output}"/> | |||||
| <cvschangelog cvsroot="${cvsroot}" | |||||
| remote="true" endTag="testtag2" | |||||
| destfile="${output}/report.xml"> | |||||
| <module name="antmodule3"/> | |||||
| </cvschangelog> | |||||
| <au:assertFileExists file="${output}/report.xml"/> | |||||
| <au:assertResourceContains resource="${output}/report.xml" | |||||
| value="[yet another test.txt]"/> | |||||
| </target> | |||||
| <target name="testRemoteChangelogWithTags"> | |||||
| <mkdir dir="${output}"/> | |||||
| <cvschangelog cvsroot="${cvsroot}" | |||||
| remote="true" endTag="testtag2" startTag="testtag1" | |||||
| destfile="${output}/report.xml"> | |||||
| <module name="antmodule3"/> | |||||
| </cvschangelog> | |||||
| <au:assertFileExists file="${output}/report.xml"/> | |||||
| <au:assertResourceContains resource="${output}/report.xml" | |||||
| value="[yet another test.txt]"/> | |||||
| </target> | |||||
| <target name="xtestLocalChangelogStartTag"> | |||||
| <mkdir dir="${output}"/> | |||||
| <cvs cvsroot="${cvsroot}" package="antmodule3" dest="${output}"/> | |||||
| <cvschangelog dir="${output}/antmodule3" | |||||
| remote="false" startTag="testtag1" | |||||
| destfile="${output}/report.xml"/> | |||||
| <au:assertFileExists file="${output}/report.xml"/> | |||||
| <au:assertResourceContains resource="${output}/report.xml" | |||||
| value="[yet another test.txt]"/> | |||||
| </target> | |||||
| <target name="testLocalChangelogEndTag"> | |||||
| <mkdir dir="${output}"/> | |||||
| <cvs cvsroot="${cvsroot}" package="antmodule3" dest="${output}"/> | |||||
| <cvschangelog dir="${output}/antmodule3" | |||||
| remote="false" endTag="testtag2" | |||||
| destfile="${output}/report.xml"/> | |||||
| <au:assertFileExists file="${output}/report.xml"/> | |||||
| <au:assertResourceContains resource="${output}/report.xml" | |||||
| value="[yet another test.txt]"/> | |||||
| </target> | |||||
| <target name="testLocalChangelogWithTags"> | |||||
| <mkdir dir="${output}"/> | |||||
| <cvs cvsroot="${cvsroot}" package="antmodule3" dest="${output}"/> | |||||
| <cvschangelog dir="${output}/antmodule3" | |||||
| remote="false" endTag="testtag2" startTag="testtag1" | |||||
| destfile="${output}/report.xml"/> | |||||
| <au:assertFileExists file="${output}/report.xml"/> | |||||
| <au:assertResourceContains resource="${output}/report.xml" | |||||
| value="[yet another test.txt]"/> | |||||
| </target> | |||||
| <target name="testCvsWithSpaceInModule"> | <target name="testCvsWithSpaceInModule"> | ||||
| <mkdir dir="${output}"/> | <mkdir dir="${output}"/> | ||||
| <cvs cvsroot="${cvsroot}" dest="${output}"> | <cvs cvsroot="${cvsroot}" dest="${output}"> | ||||
| @@ -28,3 +28,27 @@ O48f8a764|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 | |||||
| O48f8a766|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | O48f8a766|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | ||||
| O48f8abf0|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 | O48f8abf0|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 | ||||
| O48f8abf2|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | O48f8abf2|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | ||||
| O48f8ad8b|stefan|~/ASF/ant/ant-HEAD/*0|antmodule3||antmodule3 | |||||
| M48f8add7|stefan|~/ASF/ant/ant-HEAD/*0|antmodule3|1.2|yet another test.txt | |||||
| O48f8ae09|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 | |||||
| O48f8ae0a|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | |||||
| O48f8b07c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b07d|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b07e|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | |||||
| O48f8b07f|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b082|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 | |||||
| O48f8b141|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b14c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b1c3|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b1cd|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b20c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b217|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b301|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b302|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | |||||
| O48f8b303|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b307|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 | |||||
| O48f8b308|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b328|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| O48f8b329|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | |||||
| O48f8b32b|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 | |||||
| O48f8b32c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3 | |||||
| @@ -0,0 +1,2 @@ | |||||
| testtag1 y | |||||
| testtag2 y | |||||
| @@ -1,35 +1,54 @@ | |||||
| head 1.1; | |||||
| branch 1.1.1; | |||||
| access ; | |||||
| symbols start:1.1.1.1 ant:1.1.1; | |||||
| locks ; strict; | |||||
| comment @# @; | |||||
| head 1.2; | |||||
| access; | |||||
| symbols | |||||
| testtag2:1.2 | |||||
| testtag1:1.1.1.1 | |||||
| start:1.1.1.1 | |||||
| ant:1.1.1; | |||||
| locks; strict; | |||||
| comment @# @; | |||||
| 1.2 | |||||
| date 2008.10.17.15.23.03; author stefan; state Exp; | |||||
| branches; | |||||
| next 1.1; | |||||
| commitid 7ddc48f8add74567; | |||||
| 1.1 | 1.1 | ||||
| date 2008.10.16.14.51.11; author stefan; state Exp; | |||||
| branches 1.1.1.1; | |||||
| next ; | |||||
| commitid 7f8d48f754df4567; | |||||
| date 2008.10.16.14.51.11; author stefan; state Exp; | |||||
| branches | |||||
| 1.1.1.1; | |||||
| next ; | |||||
| commitid 7f8d48f754df4567; | |||||
| 1.1.1.1 | 1.1.1.1 | ||||
| date 2008.10.16.14.51.11; author stefan; state Exp; | |||||
| branches ; | |||||
| next ; | |||||
| commitid 7f8d48f754df4567; | |||||
| date 2008.10.16.14.51.11; author stefan; state Exp; | |||||
| branches; | |||||
| next ; | |||||
| commitid 7f8d48f754df4567; | |||||
| desc | desc | ||||
| @@ | @@ | ||||
| 1.2 | |||||
| log | |||||
| @update weather report | |||||
| @ | |||||
| text | |||||
| @dark and cloudy. | |||||
| a bit brighter today. | |||||
| @ | |||||
| 1.1 | 1.1 | ||||
| log | log | ||||
| @Initial revision | @Initial revision | ||||
| @ | @ | ||||
| text | text | ||||
| @dark and cloudy. | |||||
| @d2 1 | |||||
| @ | @ | ||||