diff --git a/WHATSNEW b/WHATSNEW index 95e37f75f..1c651ca3b 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -473,6 +473,10 @@ Other changes: work against a remote repository without any working copy. Bugzilla Report 27419. + * start and end tags can now be used instead of dates in + . + Bugzilla Report 27419. + Changes from Ant 1.7.0 TO Ant 1.7.1 ============================================= diff --git a/docs/manual/CoreTasks/changelog.html b/docs/manual/CoreTasks/changelog.html index d90aa3c27..f93c638bd 100644 --- a/docs/manual/CoreTasks/changelog.html +++ b/docs/manual/CoreTasks/changelog.html @@ -132,6 +132,23 @@ operation may fail when using such an incompatible client. false. Since Ant 1.8.0 No + + startTag + 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. Since Ant 1.8.0 + No + + + endTag + 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. included in the report. + Since Ant 1.8.0 + No +

Parameters specified as nested elements

diff --git a/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java b/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java index cef90f299..b49033396 100644 --- a/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java @@ -98,6 +98,11 @@ public class ChangeLogTask extends AbstractCvsTask { /** Determines whether log (false) or rlog (true) is used */ 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 @@ -191,6 +196,25 @@ public class ChangeLogTask extends AbstractCvsTask { 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. * @@ -250,7 +274,12 @@ public class ChangeLogTask extends AbstractCvsTask { // parse. 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 = new SimpleDateFormat("yyyy-MM-dd"); @@ -336,6 +365,12 @@ public class ChangeLogTask extends AbstractCvsTask { 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); + } } /** diff --git a/src/tests/antunit/taskdefs/cvs/cvs.xml b/src/tests/antunit/taskdefs/cvs/cvs.xml index d7184faef..564e5875a 100644 --- a/src/tests/antunit/taskdefs/cvs/cvs.xml +++ b/src/tests/antunit/taskdefs/cvs/cvs.xml @@ -60,6 +60,75 @@ value="[yet another test.txt]"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history b/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history index a464ae678..fe86e1afe 100644 --- a/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history +++ b/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history @@ -28,3 +28,27 @@ O48f8a764|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 O48f8a766|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 O48f8abf0|stefan|/tmp/testoutput/*0|ant module 2||ant module 2 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 diff --git a/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/val-tags b/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/val-tags index e69de29bb..a76de2022 100644 --- a/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/val-tags +++ b/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/val-tags @@ -0,0 +1,2 @@ +testtag1 y +testtag2 y diff --git a/src/tests/antunit/taskdefs/cvs/repository/antmodule3/yet another test.txt,v b/src/tests/antunit/taskdefs/cvs/repository/antmodule3/yet another test.txt,v index 3514e950f..08f13b002 100644 --- a/src/tests/antunit/taskdefs/cvs/repository/antmodule3/yet another test.txt,v +++ b/src/tests/antunit/taskdefs/cvs/repository/antmodule3/yet another test.txt,v @@ -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 -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 -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 @@ +1.2 +log +@update weather report +@ +text +@dark and cloudy. +a bit brighter today. +@ + 1.1 log @Initial revision @ text -@dark and cloudy. +@d2 1 @