diff --git a/changelog/plugin.jelly b/changelog/plugin.jelly index 0c98cce3..d522da36 100644 --- a/changelog/plugin.jelly +++ b/changelog/plugin.jelly @@ -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}" diff --git a/changelog/plugin.properties b/changelog/plugin.properties index e554e3e9..b8b57b96 100644 --- a/changelog/plugin.properties +++ b/changelog/plugin.properties @@ -28,3 +28,4 @@ maven.changelog.range = 30 #maven.changelog.date = #maven.changelog.tag = +maven.changelog.quoteDate=false diff --git a/changelog/src/main/org/apache/maven/changelog/ChangeLog.java b/changelog/src/main/org/apache/maven/changelog/ChangeLog.java index 3318ba41..92998ab9 100644 --- a/changelog/src/main/org/apache/maven/changelog/ChangeLog.java +++ b/changelog/src/main/org/apache/maven/changelog/ChangeLog.java @@ -80,6 +80,11 @@ public class ChangeLog */ 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 @@ public class ChangeLog { 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 diff --git a/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java b/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java index 46edeb22..766bb908 100644 --- a/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java +++ b/changelog/src/main/org/apache/maven/cvslib/CvsChangeLogGenerator.java @@ -28,6 +28,7 @@ import java.util.Date; 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 @@ class CvsChangeLogGenerator extends AbstractChangeLogGenerator 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 @@ class CvsChangeLogGenerator extends AbstractChangeLogGenerator 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 @@ class CvsChangeLogGenerator extends AbstractChangeLogGenerator { 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 + "\""; } diff --git a/changelog/xdocs/changes.xml b/changelog/xdocs/changes.xml index be5a10e1..6599c874 100644 --- a/changelog/xdocs/changes.xml +++ b/changelog/xdocs/changes.xml @@ -25,6 +25,7 @@
maven.changelog.quoteDate.maven.changelog.svn.baseurl.${pom.repository.url}.
+ false.
+