PR: MPCHANGELOG-69

Changelog returns 0 entries on Windows with CVS (not CVSNT).
New property maven.changelog.quoteDate.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@369970 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl
2006-01-18 00:12:15 +00:00
parent 21538feada
commit b2f87e787f
6 changed files with 74 additions and 2 deletions

View File

@@ -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}"

View File

@@ -28,3 +28,4 @@ maven.changelog.range = 30
#maven.changelog.date =
#maven.changelog.tag =
maven.changelog.quoteDate=false

View File

@@ -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

View File

@@ -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 + "\"";
}

View File

@@ -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>

View File

@@ -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">