Author: ltheussl Date: Tue Jan 17 16:12:15 2006 New Revision: 369970 URL: http://svn.apache.org/viewcvs?rev=369970&view=rev Log: PR: MPCHANGELOG-69 Changelog returns 0 entries on Windows with CVS (not CVSNT). New property maven.changelog.quoteDate.
Modified: maven/maven-1/plugins/trunk/changelog/plugin.jelly maven/maven-1/plugins/trunk/changelog/plugin.properties maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml maven/maven-1/plugins/trunk/changelog/xdocs/properties.xml Modified: maven/maven-1/plugins/trunk/changelog/plugin.jelly URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/plugin.jelly?rev=369970&r1=369969&r2=369970&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/changelog/plugin.jelly (original) +++ maven/maven-1/plugins/trunk/changelog/plugin.jelly Tue Jan 17 16:12:15 2006 @@ -102,6 +102,7 @@ range="${maven.changelog.range}" date="${maven.changelog.date}" tag="${maven.changelog.tag}" + quoteDate="${maven.changelog.quoteDate}" repositoryConnection="${_connection}" dateFormat="${maven.changelog.dateformat}" commentFormat="${maven.changelog.commentFormat}" Modified: maven/maven-1/plugins/trunk/changelog/plugin.properties URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/plugin.properties?rev=369970&r1=369969&r2=369970&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/changelog/plugin.properties (original) +++ maven/maven-1/plugins/trunk/changelog/plugin.properties Tue Jan 17 16:12:15 2006 @@ -28,3 +28,4 @@ #maven.changelog.date = #maven.changelog.tag = +maven.changelog.quoteDate=false Modified: maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java?rev=369970&r1=369969&r2=369970&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java (original) +++ maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/changelog/ChangeLog.java Tue Jan 17 16:12:15 2006 @@ -80,6 +80,11 @@ */ private String dateFormat; + /** + * Specifies whether to quote date argument (used by CvsChangeLogGenerator). + */ + private boolean quoteDate; + /** * Input dir. Working directory for running CVS executable */ @@ -302,7 +307,26 @@ { return dateFormat; } - + + /** + * Set the quoteDate property. + * @param newQuoteDate the quoteDate property to set. + */ + public void setQuoteDate(boolean newQuoteDate) + { + this.quoteDate = newQuoteDate; + } + + /** + * Get the quoteDate property. + * + * @return the quoteDate property. + */ + public boolean getQuoteDate() + { + return quoteDate; + } + /** * Set the base directory for the change log generator. * @param base the base directory Modified: maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java?rev=369970&r1=369969&r2=369970&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java (original) +++ maven/maven-1/plugins/trunk/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java Tue Jan 17 16:12:15 2006 @@ -28,6 +28,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.changelog.AbstractChangeLogGenerator; +import org.apache.maven.changelog.ChangeLog; import org.apache.maven.changelog.ChangeLogParser; import org.apache.maven.util.AsyncStreamReader; import org.apache.maven.util.RepositoryUtils; @@ -54,6 +55,8 @@ private static final Log LOG = LogFactory.getLog(CvsChangeLogGenerator.class); + private boolean quoteDate; + public static final int POS_SCM = 0; public static final int POS_SCM_TYPE = 1; public static final int POS_SCM_SUBTYPE = 2; @@ -61,6 +64,39 @@ public static final int POS_SCM_PATH = 4; public static final int POS_SCM_MODULE = 5; + + /** + * Set the quoteDate property. + * @param newQuoteDate the quoteDate property to set. + */ + public void setQuoteDate(boolean newQuoteDate) + { + this.quoteDate = newQuoteDate; + } + + /** + * Get the quoteDate property. + * + * @return the quoteDate property. + */ + public boolean getQuoteDate() + { + return quoteDate; + } + + + /** + * Initialize the generator from the changelog controller. + * + * @param changeLog The invoking controller (useful for logging) + * @see ChangeLogGenerator#init(ChangeLog) + */ + public void init(ChangeLog changeLog) + { + setQuoteDate(changeLog.getQuoteDate()); + super.init(changeLog); + } + /** * Execute cvslib client driving the given parser. @todo Currently the * output from the logListener is a String, which is then converted to an @@ -198,7 +234,7 @@ { SimpleDateFormat outputDate = new SimpleDateFormat("yyyy-MM-dd"); String cmd = outputDate.format(before) + "<" + outputDate.format(to); - if ( System.getProperty( "os.name" ).startsWith( "Windows" ) ) + if ( getQuoteDate() ) { cmd = "\"" + cmd + "\""; } Modified: maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml?rev=369970&r1=369969&r2=369970&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml (original) +++ maven/maven-1/plugins/trunk/changelog/xdocs/changes.xml Tue Jan 17 16:12:15 2006 @@ -25,6 +25,7 @@ </properties> <body> <release version="1.9-SNAPSHOT" date="in SVN"> + <action dev="ltheussl" type="fix" issue="MPCHANGELOG-69">Changelog returns 0 entries on Windows with CVS (not CVSNT). New property <code>maven.changelog.quoteDate</code>.</action> <action dev="ltheussl" type="fix" issue="MPCHANGELOG-74">Changelog plugin creates wrong links for Subversion repositories. New property <code>maven.changelog.svn.baseurl</code>.</action> <action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated : <ul> Modified: maven/maven-1/plugins/trunk/changelog/xdocs/properties.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/changelog/xdocs/properties.xml?rev=369970&r1=369969&r2=369970&view=diff ============================================================================== --- maven/maven-1/plugins/trunk/changelog/xdocs/properties.xml (original) +++ maven/maven-1/plugins/trunk/changelog/xdocs/properties.xml Tue Jan 17 16:12:15 2006 @@ -146,6 +146,15 @@ Defaults to <code>${pom.repository.url}</code>. </td> </tr> + <tr> + <td>maven.changelog.quoteDate</td> + <td>Yes</td> + <td> + Specifies whether to put quotation marks around the date argument. + This is required on some ssh clients. + Currently only used by cvs. Defaults to <code>false</code>. + </td> + </tr> </table> </section> <section name="Other properties">