You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2012/06/27 21:38:59 UTC
svn commit: r1354687 - in /maven/scm/trunk:
maven-scm-api/src/main/java/org/apache/maven/scm/
maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/
maven-scm-api/src/main/java/org/apache/maven/scm/manager/
maven-scm-api/src/main/java/org/apac...
Author: olamy
Date: Wed Jun 27 19:38:56 2012
New Revision: 1354687
URL: http://svn.apache.org/viewvc?rev=1354687&view=rev
Log:
[SCM-681] Git blame fails to report line authors on windows with core.autocrlf = true.
Added:
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/BlameScmRequest.java
- copied, changed from r1353204, maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java
Modified:
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRequest.java
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameCommand.java
maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumerTest.java
maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitExeBlameCommandTckTest.java
maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/blame/BlameCommandTckTest.java
Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/CommandParameter.java Wed Jun 27 19:38:56 2012
@@ -89,6 +89,12 @@ public class CommandParameter
*/
public static final CommandParameter FORCE_ADD = new CommandParameter( "forceAdd" );
+ /**
+ * contains true or false
+ * @since 1.8
+ */
+ public static final CommandParameter IGNORE_WHITESPACE = new CommandParameter( "ignoreWhitespace" );
+
/**
* Parameter name
Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRequest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRequest.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRequest.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/ScmRequest.java Wed Jun 27 19:38:56 2012
@@ -48,6 +48,7 @@ public class ScmRequest
public ScmRequest()
{
+ // no op
}
public ScmRequest( ScmRepository scmRepository, ScmFileSet scmFileSet )
Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java Wed Jun 27 19:38:56 2012
@@ -46,4 +46,6 @@ public abstract class AbstractBlameComma
return executeBlameCommand( repository, workingDirectory, file );
}
+
+
}
Copied: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/BlameScmRequest.java (from r1353204, maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java)
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/BlameScmRequest.java?p2=maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/BlameScmRequest.java&p1=maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java&r1=1353204&r2=1354687&rev=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/AbstractBlameCommand.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/command/blame/BlameScmRequest.java Wed Jun 27 19:38:56 2012
@@ -1,5 +1,4 @@
package org.apache.maven.scm.command.blame;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +8,7 @@ package org.apache.maven.scm.command.bla
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
@@ -20,30 +19,49 @@ package org.apache.maven.scm.command.bla
*/
import org.apache.maven.scm.CommandParameter;
-import org.apache.maven.scm.CommandParameters;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
-import org.apache.maven.scm.ScmResult;
-import org.apache.maven.scm.command.AbstractCommand;
-import org.apache.maven.scm.provider.ScmProviderRepository;
+import org.apache.maven.scm.ScmRequest;
+import org.apache.maven.scm.repository.ScmRepository;
/**
- * @author Evgeny Mandrikov
- * @since 1.4
+ * @author Olivier Lamy
+ * @since 1.8
*/
-public abstract class AbstractBlameCommand
- extends AbstractCommand
+public class BlameScmRequest
+ extends ScmRequest
{
- public abstract BlameScmResult executeBlameCommand( ScmProviderRepository repo, ScmFileSet workingDirectory,
- String filename )
- throws ScmException;
- protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet workingDirectory,
- CommandParameters parameters )
+ /**
+ * -w option for git
+ */
+ private boolean ignoreWhitespace;
+
+
+ public BlameScmRequest( ScmRepository scmRepository, ScmFileSet scmFileSet )
+ {
+ super( scmRepository, scmFileSet );
+ }
+
+ public void setFilename( String filename )
throws ScmException
{
- String file = parameters.getString( CommandParameter.FILE );
+ this.getCommandParameters().setString( CommandParameter.FILE, filename );
+ }
- return executeBlameCommand( repository, workingDirectory, file );
+ public String getFilename()
+ throws ScmException
+ {
+ return this.getCommandParameters().getString( CommandParameter.FILE );
+ }
+
+ public boolean isIgnoreWhitespace()
+ {
+ return ignoreWhitespace;
+ }
+
+ public void setIgnoreWhitespace( boolean ignoreWhitespace )
+ {
+ this.ignoreWhitespace = ignoreWhitespace;
}
}
Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/AbstractScmManager.java Wed Jun 27 19:38:56 2012
@@ -19,14 +19,6 @@ package org.apache.maven.scm.manager;
* under the License.
*/
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
import org.apache.maven.scm.ScmBranch;
import org.apache.maven.scm.ScmBranchParameters;
import org.apache.maven.scm.ScmException;
@@ -34,6 +26,7 @@ import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTagParameters;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.blame.BlameScmRequest;
import org.apache.maven.scm.command.blame.BlameScmResult;
import org.apache.maven.scm.command.branch.BranchScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
@@ -58,6 +51,14 @@ import org.apache.maven.scm.repository.S
import org.apache.maven.scm.repository.ScmRepositoryException;
import org.apache.maven.scm.repository.UnknownRepositoryStructure;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
/**
* @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
@@ -79,7 +80,7 @@ public abstract class AbstractScmManager
}
/**
- * @deprecated use {@link #setScmProvider(String,ScmProvider)} instead
+ * @deprecated use {@link #setScmProvider(String, ScmProvider)} instead
*/
protected void addScmProvider( String providerType, ScmProvider provider )
{
@@ -104,7 +105,9 @@ public abstract class AbstractScmManager
// ScmManager Implementation
// ----------------------------------------------------------------------
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmProvider getProviderByUrl( String scmUrl )
throws ScmRepositoryException, NoSuchScmProviderException
{
@@ -118,13 +121,17 @@ public abstract class AbstractScmManager
return getProviderByType( providerType );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public void setScmProviderImplementation( String providerType, String providerImplementation )
{
userProviderTypes.put( providerType, providerImplementation );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmProvider getProviderByType( String providerType )
throws NoSuchScmProviderException
{
@@ -164,7 +171,9 @@ public abstract class AbstractScmManager
return scmProvider;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmProvider getProviderByRepository( ScmRepository repository )
throws NoSuchScmProviderException
{
@@ -175,7 +184,9 @@ public abstract class AbstractScmManager
// Repository
// ----------------------------------------------------------------------
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmRepository makeScmRepository( String scmUrl )
throws ScmRepositoryException, NoSuchScmProviderException
{
@@ -254,7 +265,9 @@ public abstract class AbstractScmManager
return scmUrl;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmRepository makeProviderScmRepository( String providerType, File path )
throws ScmRepositoryException, UnknownRepositoryStructure, NoSuchScmProviderException
{
@@ -270,7 +283,9 @@ public abstract class AbstractScmManager
return new ScmRepository( providerType, providerRepository );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public List<String> validateScmRepository( String scmUrl )
{
List<String> messages = new ArrayList<String>();
@@ -307,37 +322,49 @@ public abstract class AbstractScmManager
return messages;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public AddScmResult add( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).add( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message )
throws ScmException
{
return this.getProviderByRepository( repository ).add( repository, fileSet, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName )
throws ScmException
{
ScmBranchParameters scmBranchParameters = new ScmBranchParameters( "" );
- return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName, scmBranchParameters );
+ return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName,
+ scmBranchParameters );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message )
throws ScmException
{
ScmBranchParameters scmBranchParameters = new ScmBranchParameters( message );
- return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName, scmBranchParameters );
+ return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName,
+ scmBranchParameters );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
int numDays, ScmBranch branch )
throws ScmException
@@ -346,7 +373,9 @@ public abstract class AbstractScmManager
branch );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
int numDays, ScmBranch branch, String datePattern )
throws ScmException
@@ -355,14 +384,18 @@ public abstract class AbstractScmManager
branch, datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ChangeLogScmRequest scmRequest )
throws ScmException
{
return this.getProviderByRepository( scmRequest.getScmRepository() ).changeLog( scmRequest );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion,
ScmVersion endVersion )
throws ScmException
@@ -370,7 +403,9 @@ public abstract class AbstractScmManager
return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startVersion, endVersion );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision,
ScmVersion endRevision, String datePattern )
throws ScmException
@@ -379,42 +414,54 @@ public abstract class AbstractScmManager
datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message )
throws ScmException
{
return this.getProviderByRepository( repository ).checkIn( repository, fileSet, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message )
throws ScmException
{
return this.getProviderByRepository( repository ).checkIn( repository, fileSet, revision, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).checkOut( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
throws ScmException
{
return this.getProviderByRepository( repository ).checkOut( repository, fileSet, version );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, boolean recursive )
throws ScmException
{
return this.getProviderByRepository( repository ).checkOut( repository, fileSet, recursive );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version,
boolean recursive )
throws ScmException
@@ -422,7 +469,9 @@ public abstract class AbstractScmManager
return this.getProviderByRepository( repository ).checkOut( repository, fileSet, version, recursive );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion,
ScmVersion endVersion )
throws ScmException
@@ -430,28 +479,36 @@ public abstract class AbstractScmManager
return this.getProviderByRepository( repository ).diff( repository, fileSet, startVersion, endVersion );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public EditScmResult edit( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).edit( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).export( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
throws ScmException
{
return this.getProviderByRepository( repository ).export( repository, fileSet, version );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String outputDirectory )
throws ScmException
{
@@ -459,7 +516,9 @@ public abstract class AbstractScmManager
outputDirectory );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version,
String outputDirectory )
throws ScmException
@@ -467,42 +526,54 @@ public abstract class AbstractScmManager
return this.getProviderByRepository( repository ).export( repository, fileSet, version, outputDirectory );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version )
throws ScmException
{
return this.getProviderByRepository( repository ).list( repository, fileSet, recursive, version );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public MkdirScmResult mkdir( ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal )
throws ScmException
{
return this.getProviderByRepository( repository ).mkdir( repository, fileSet, message, createInLocal );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message )
throws ScmException
{
return this.getProviderByRepository( repository ).remove( repository, fileSet, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public StatusScmResult status( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).status( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName )
throws ScmException
{
return this.tag( repository, fileSet, tagName, "" );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message )
throws ScmException
{
@@ -510,35 +581,45 @@ public abstract class AbstractScmManager
return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName, scmTagParameters );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).unedit( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, version );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, runChangelog );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version,
boolean runChangelog )
throws ScmException
@@ -546,14 +627,18 @@ public abstract class AbstractScmManager
return this.getProviderByRepository( repository ).update( repository, fileSet, version, runChangelog );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String datePattern )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version,
String datePattern )
throws ScmException
@@ -561,21 +646,27 @@ public abstract class AbstractScmManager
return this.getProviderByRepository( repository ).update( repository, fileSet, version, datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, lastUpdate );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, version, lastUpdate );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern )
throws ScmException
{
@@ -583,7 +674,9 @@ public abstract class AbstractScmManager
datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate,
String datePattern )
throws ScmException
@@ -592,10 +685,18 @@ public abstract class AbstractScmManager
datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public BlameScmResult blame( ScmRepository repository, ScmFileSet fileSet, String filename )
throws ScmException
{
return this.getProviderByRepository( repository ).blame( repository, fileSet, filename );
}
+
+ public BlameScmResult blame( BlameScmRequest blameScmRequest )
+ throws ScmException
+ {
+ return this.getProviderByRepository( blameScmRequest.getScmRepository() ).blame( blameScmRequest );
+ }
}
Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/manager/ScmManager.java Wed Jun 27 19:38:56 2012
@@ -24,6 +24,7 @@ import org.apache.maven.scm.ScmException
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.blame.BlameScmRequest;
import org.apache.maven.scm.command.blame.BlameScmResult;
import org.apache.maven.scm.command.branch.BranchScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
@@ -66,10 +67,10 @@ public interface ScmManager
/**
* Generate a SCMRepository from a SCM url.
- *
+ *
* @param scmUrl the scm url
* @return The scm repository
- * @throws ScmRepositoryException if an error occurs in the scm repository construction
+ * @throws ScmRepositoryException if an error occurs in the scm repository construction
* @throws NoSuchScmProviderException if the provider doesn't exist
*/
ScmRepository makeScmRepository( String scmUrl )
@@ -80,7 +81,7 @@ public interface ScmManager
/**
* Validate a SCM URL.
- *
+ *
* @param scmUrl the SCM URL to validate
* @return <code>List</code> of <code>String</code> objects with the messages returned by the SCM provider
*/
@@ -93,7 +94,7 @@ public interface ScmManager
* Returns the default provider registered for this providerType or a specific implementation if the
* 'maven.scm.provider.providerType.implementation' system property is defined. For example:
* maven.scm.provider.cvs.implementation=cvs_native
- *
+ *
* @param providerType The provider type (cvs, svn...)
* @return The scm provider
* @throws NoSuchScmProviderException if the provider doesn't exist
@@ -107,38 +108,39 @@ public interface ScmManager
/**
* Set a provider to be used for a type of SCM. If there was already a designed provider for that type it will be
* replaced.
- *
+ *
* @param providerType the type of SCM, eg. <code>svn</code>, <code>cvs</code>
- * @param provider the provider that will be used for that SCM type
+ * @param provider the provider that will be used for that SCM type
*/
void setScmProvider( String providerType, ScmProvider provider );
/**
* Set the provider implementation
- *
- * @param providerType The provider type, eg. <code>cvs</code>
+ *
+ * @param providerType The provider type, eg. <code>cvs</code>
* @param providerImplementation The provider implementation (the role-hint of the provider), eg. <code>cvs</code>,
- * <code>cvs_native</code>
+ * <code>cvs_native</code>
*/
void setScmProviderImplementation( String providerType, String providerImplementation );
/**
* Adds the given files to the source control system
- *
+ *
* @param repository the source control system
- * @param fileSet the files to be added
+ * @param fileSet the files to be added
* @return an {@link org.apache.maven.scm.command.add.AddScmResult} that contains the files that have been added
* @throws org.apache.maven.scm.ScmException
+ *
*/
AddScmResult add( ScmRepository repository, ScmFileSet fileSet )
throws ScmException;
/**
* Adds the given files to the source control system
- *
+ *
* @param repository the source control system
- * @param fileSet the files to be added
- * @param message a string that is a comment on the new added file
+ * @param fileSet the files to be added
+ * @param message a string that is a comment on the new added file
* @return an {@link AddScmResult} that contains the files that have been added
* @throws ScmException if any
*/
@@ -147,10 +149,10 @@ public interface ScmManager
/**
* Branch (or label in some systems) will create a branch of the source file with a certain branch name
- *
+ *
* @param repository the source control system
- * @param fileSet the files to branch. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ * @param fileSet the files to branch. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
* @param branchName the branch name to apply to the files
* @return
* @throws ScmException if any
@@ -160,12 +162,12 @@ public interface ScmManager
/**
* Branch (or label in some systems) will create a branch of the source file with a certain branch name
- *
+ *
* @param repository the source control system
- * @param fileSet the files to branch. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ * @param fileSet the files to branch. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
* @param branchName the branch name to apply to the files
- * @param message the commit message used for the tag creation
+ * @param message the commit message used for the tag creation
* @return
* @throws ScmException if any
*/
@@ -175,14 +177,14 @@ public interface ScmManager
/**
* Returns the changes that have happend in the source control system in a certain period of time. This can be
* adding, removing, updating, ... of files
- *
+ *
* @param repository the source control system
- * @param fileSet the files to know the changes about. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
- * @param startDate the start date of the period
- * @param endDate the end date of the period
- * @param numDays the number days before the current time if startdate and enddate are null
- * @param branch the branch/tag
+ * @param fileSet the files to know the changes about. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ * @param startDate the start date of the period
+ * @param endDate the end date of the period
+ * @param numDays the number days before the current time if startdate and enddate are null
+ * @param branch the branch/tag
* @return The SCM result of the changelog command
* @throws ScmException if any
* @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
@@ -195,14 +197,14 @@ public interface ScmManager
/**
* Returns the changes that have happend in the source control system in a certain period of time. This can be
* adding, removing, updating, ... of files
- *
- * @param repository the source control system
- * @param fileSet the files to know the changes about. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
- * @param startDate the start date of the period
- * @param endDate the end date of the period
- * @param numDays the number days before the current time if startdate and enddate are null
- * @param branch the branch/tag
+ *
+ * @param repository the source control system
+ * @param fileSet the files to know the changes about. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ * @param startDate the start date of the period
+ * @param endDate the end date of the period
+ * @param numDays the number days before the current time if startdate and enddate are null
+ * @param branch the branch/tag
* @param datePattern the date pattern use in changelog output returned by scm tool
* @return The SCM result of the changelog command
* @throws ScmException if any
@@ -228,12 +230,12 @@ public interface ScmManager
/**
* Returns the changes that have happend in the source control system between two tags. This can be adding,
* removing, updating, ... of files
- *
- * @param repository the source control system
- * @param fileSet the files to know the changes about. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ *
+ * @param repository the source control system
+ * @param fileSet the files to know the changes about. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
* @param startVersion the start branch/tag/revision
- * @param endVersion the end branch/tag/revision
+ * @param endVersion the end branch/tag/revision
* @return The SCM result of the changelog command
* @throws ScmException if any
* @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
@@ -246,13 +248,13 @@ public interface ScmManager
/**
* Returns the changes that have happend in the source control system between two tags. This can be adding,
* removing, updating, ... of files
- *
- * @param repository the source control system
- * @param fileSet the files to know the changes about. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ *
+ * @param repository the source control system
+ * @param fileSet the files to know the changes about. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
* @param startRevision the start revision
- * @param endRevision the end revision
- * @param datePattern the date pattern use in changelog output returned by scm tool
+ * @param endRevision the end revision
+ * @param datePattern the date pattern use in changelog output returned by scm tool
* @return
* @throws ScmException if any
* @deprecated use {@link #changeLog(org.apache.maven.scm.command.changelog.ChangeLogScmRequest)} instead
@@ -268,10 +270,10 @@ public interface ScmManager
* <p/>
* When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. When the fileSet has entries,
* the commit is non-recursive and only the elements in the fileSet are committed.
- *
+ *
* @param repository the source control system
- * @param fileSet the files to check in (sometimes called commit)
- * @param message a string that is a comment on the changes that where done
+ * @param fileSet the files to check in (sometimes called commit)
+ * @param message a string that is a comment on the changes that where done
* @return
* @throws ScmException if any
*/
@@ -284,11 +286,11 @@ public interface ScmManager
* <p/>
* When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. When the fileSet has entries,
* the commit is non-recursive and only the elements in the fileSet are committed.
- *
+ *
* @param repository the source control system
- * @param fileSet the files to check in (sometimes called commit)
- * @param revision branch/tag/revision
- * @param message a string that is a comment on the changes that where done
+ * @param fileSet the files to check in (sometimes called commit)
+ * @param revision branch/tag/revision
+ * @param message a string that is a comment on the changes that where done
* @return
* @throws ScmException if any
*/
@@ -297,9 +299,9 @@ public interface ScmManager
/**
* Create a copy of the repository on your local machine
- *
+ *
* @param repository the source control system
- * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
* @return
* @throws ScmException if any
*/
@@ -308,10 +310,10 @@ public interface ScmManager
/**
* Create a copy of the repository on your local machine
- *
+ *
* @param repository the source control system
- * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
- * @param version get the version defined by the revision, branch or tag
+ * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ * @param version get the version defined by the revision, branch or tag
* @return
* @throws ScmException if any
*/
@@ -320,10 +322,10 @@ public interface ScmManager
/**
* Create a copy of the repository on your local machine.
- *
+ *
* @param scmRepository the source control system
- * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
- * @param recursive whether to check out recursively
+ * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ * @param recursive whether to check out recursively
* @return
* @throws ScmException if any
*/
@@ -332,11 +334,11 @@ public interface ScmManager
/**
* Create a copy of the repository on your local machine.
- *
+ *
* @param scmRepository the source control system
- * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
- * @param version get the version defined by the revision, branch or tag
- * @param recursive whether to check out recursively
+ * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ * @param version get the version defined by the revision, branch or tag
+ * @param recursive whether to check out recursively
* @return
* @throws ScmException if any
*/
@@ -346,11 +348,11 @@ public interface ScmManager
/**
* Create a diff between two branch/tag/revision.
- *
+ *
* @param scmRepository the source control system
- * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
- * @param startVersion the start branch/tag/revision
- * @param endVersion the end branch/tag/revision
+ * @param scmFileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ * @param startVersion the start branch/tag/revision
+ * @param endVersion the end branch/tag/revision
* @return
* @throws ScmException if any
*/
@@ -362,9 +364,9 @@ public interface ScmManager
* Make a file editable. This is used in source control systems where you look at read-only files and you need to
* make them not read-only anymore before you can edit them. This can also mean that no other user in the system can
* make the file not read-only anymore.
- *
+ *
* @param repository the source control system
- * @param fileSet the files to make editable
+ * @param fileSet the files to make editable
* @return
* @throws ScmException if any
*/
@@ -373,9 +375,9 @@ public interface ScmManager
/**
* Create an exported copy of the repository on your local machine
- *
+ *
* @param repository the source control system
- * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
* @return
* @throws ScmException if any
*/
@@ -384,10 +386,10 @@ public interface ScmManager
/**
* Create an exported copy of the repository on your local machine
- *
+ *
* @param repository the source control system
- * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
- * @param version get the version defined by the branch/tag/revision
+ * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ * @param version get the version defined by the branch/tag/revision
* @return
* @throws ScmException if any
*/
@@ -396,9 +398,9 @@ public interface ScmManager
/**
* Create an exported copy of the repository on your local machine
- *
- * @param repository the source control system
- * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ *
+ * @param repository the source control system
+ * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
* @param outputDirectory the directory where the export will be stored
* @return
* @throws ScmException if any
@@ -408,10 +410,10 @@ public interface ScmManager
/**
* Create an exported copy of the repository on your local machine
- *
- * @param repository the source control system
- * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
- * @param version get the version defined by the branch/tag/revision
+ *
+ * @param repository the source control system
+ * @param fileSet the files are copied to the {@link org.apache.maven.scm.ScmFileSet#getBasedir()} location
+ * @param version get the version defined by the branch/tag/revision
* @param outputDirectory the directory where the export will be stored
* @return
* @throws ScmException if any
@@ -421,11 +423,11 @@ public interface ScmManager
/**
* List each element (files and directories) of <B>fileSet</B> as they exist in the repository.
- *
+ *
* @param repository the source control system
- * @param fileSet the files to list
- * @param recursive descend recursively
- * @param version use the version defined by the branch/tag/revision
+ * @param fileSet the files to list
+ * @param recursive descend recursively
+ * @param version use the version defined by the branch/tag/revision
* @return the list of files in the repository
*/
ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version )
@@ -433,11 +435,11 @@ public interface ScmManager
/**
* Create new directory/directories in the repository.
- *
+ *
* @param repository
* @param fileSet
* @param message
- * @param createInLocal
+ * @param createInLocal
* @return
* @throws ScmException
*/
@@ -446,9 +448,9 @@ public interface ScmManager
/**
* Removes the given files from the source control system
- *
+ *
* @param repository the source control system
- * @param fileSet the files to be removed
+ * @param fileSet the files to be removed
* @param message
* @return
* @throws ScmException if any
@@ -459,10 +461,10 @@ public interface ScmManager
/**
* Returns the status of the files in the source control system. The state of each file can be one of the
* {@link org.apache.maven.scm.ScmFileStatus} flags.
- *
+ *
* @param repository the source control system
- * @param fileSet the files to know the status about. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ * @param fileSet the files to know the status about. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
* @return
* @throws ScmException if any
*/
@@ -471,11 +473,11 @@ public interface ScmManager
/**
* Tag (or label in some systems) will tag the source file with a certain tag
- *
+ *
* @param repository the source control system
- * @param fileSet the files to tag. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
- * @param tagName the tag name to apply to the files
+ * @param fileSet the files to tag. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ * @param tagName the tag name to apply to the files
* @return
* @throws ScmException if any
*/
@@ -484,12 +486,12 @@ public interface ScmManager
/**
* Tag (or label in some systems) will tag the source file with a certain tag
- *
+ *
* @param repository the source control system
- * @param fileSet the files to tag. Implementations can also give the changes from the
- * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
- * @param tagName the tag name to apply to the files
- * @param message the commit message used for the tag creation
+ * @param fileSet the files to tag. Implementations can also give the changes from the
+ * {@link org.apache.maven.scm.ScmFileSet#getBasedir()} downwards.
+ * @param tagName the tag name to apply to the files
+ * @param message the commit message used for the tag creation
* @return
* @throws ScmException if any
*/
@@ -498,11 +500,11 @@ public interface ScmManager
/**
* Make a file no longer editable. This is the conterpart of
- * {@link #edit(org.apache.maven.scm.repository.ScmRepository,org.apache.maven.scm.ScmFileSet)}. It makes the file
+ * {@link #edit(org.apache.maven.scm.repository.ScmRepository, org.apache.maven.scm.ScmFileSet)}. It makes the file
* read-only again.
- *
+ *
* @param repository the source control system
- * @param fileSet the files to make uneditable
+ * @param fileSet the files to make uneditable
* @return
* @throws ScmException if any
*/
@@ -511,9 +513,9 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
+ *
* @param repository the source control system
- * @param fileSet location of your local copy
+ * @param fileSet location of your local copy
* @return
* @throws ScmException if any
*/
@@ -522,10 +524,10 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
+ *
* @param repository the source control system
- * @param fileSet location of your local copy
- * @param version use the version defined by the branch/tag/revision
+ * @param fileSet location of your local copy
+ * @param version use the version defined by the branch/tag/revision
* @return
* @throws ScmException if any
*/
@@ -534,9 +536,9 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
- * @param repository the source control system
- * @param fileSet location of your local copy
+ *
+ * @param repository the source control system
+ * @param fileSet location of your local copy
* @param runChangelog Run the changelog command after the update
* @return
* @throws ScmException if any
@@ -546,10 +548,10 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
- * @param repository the source control system
- * @param fileSet location of your local copy
- * @param version use the version defined by the branch/tag/revision
+ *
+ * @param repository the source control system
+ * @param fileSet location of your local copy
+ * @param version use the version defined by the branch/tag/revision
* @param runChangelog Run the changelog command after the update
* @return
* @throws ScmException if any
@@ -559,9 +561,9 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
- * @param repository the source control system
- * @param fileSet location of your local copy
+ *
+ * @param repository the source control system
+ * @param fileSet location of your local copy
* @param datePattern the date pattern use in changelog output returned by scm tool
* @return
* @throws ScmException if any
@@ -571,10 +573,10 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
- * @param repository the source control system
- * @param fileSet location of your local copy
- * @param version use the version defined by the branch/tag/revision
+ *
+ * @param repository the source control system
+ * @param fileSet location of your local copy
+ * @param version use the version defined by the branch/tag/revision
* @param datePattern the date pattern use in changelog output returned by scm tool
* @return
* @throws ScmException if any
@@ -584,9 +586,9 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
+ *
* @param repository the source control system
- * @param fileSet location of your local copy
+ * @param fileSet location of your local copy
* @param lastUpdate
* @return
* @throws ScmException if any
@@ -596,10 +598,10 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
+ *
* @param repository the source control system
- * @param fileSet location of your local copy
- * @param version use the version defined by the branch/tag/revision
+ * @param fileSet location of your local copy
+ * @param version use the version defined by the branch/tag/revision
* @param lastUpdate
* @return
* @throws ScmException if any
@@ -609,10 +611,10 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
- * @param repository the source control system
- * @param fileSet location of your local copy
- * @param lastUpdate Date of last update
+ *
+ * @param repository the source control system
+ * @param fileSet location of your local copy
+ * @param lastUpdate Date of last update
* @param datePattern the date pattern use in changelog output returned by scm tool
* @return
* @throws ScmException if any
@@ -622,11 +624,11 @@ public interface ScmManager
/**
* Updates the copy on the local machine with the changes in the repository
- *
- * @param repository the source control system
- * @param fileSet location of your local copy
- * @param version use the version defined by the branch/tag/revision
- * @param lastUpdate Date of last update
+ *
+ * @param repository the source control system
+ * @param fileSet location of your local copy
+ * @param version use the version defined by the branch/tag/revision
+ * @param lastUpdate Date of last update
* @param datePattern the date pattern use in changelog output returned by scm tool
* @return
* @throws ScmException if any
@@ -637,14 +639,23 @@ public interface ScmManager
/**
* Returns the blame of specified file
- *
+ *
* @param repository the source control system
- * @param fileSet location of your local copy
- * @param filename file
+ * @param fileSet location of your local copy
+ * @param filename file
* @return blame for specified file
- * @since 1.4
* @throws ScmException if any
+ * @since 1.4
*/
BlameScmResult blame( ScmRepository repository, ScmFileSet fileSet, String filename )
throws ScmException;
+
+ /**
+ * @param blameScmRequest
+ * @return blame for specified file
+ * @throws ScmException if any
+ * @since 1.4
+ */
+ BlameScmResult blame( BlameScmRequest blameScmRequest )
+ throws ScmException;
}
Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/AbstractScmProvider.java Wed Jun 27 19:38:56 2012
@@ -30,6 +30,7 @@ import org.apache.maven.scm.ScmRevision;
import org.apache.maven.scm.ScmTagParameters;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.blame.BlameScmRequest;
import org.apache.maven.scm.command.blame.BlameScmResult;
import org.apache.maven.scm.command.branch.BranchScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
@@ -1088,6 +1089,13 @@ public abstract class AbstractScmProvide
throw new NoSuchCommandScmException( "blame" );
}
+ public BlameScmResult blame( BlameScmRequest blameScmRequest )
+ throws ScmException
+ {
+ return blame( blameScmRequest.getScmRepository().getProviderRepository(), blameScmRequest.getScmFileSet(),
+ blameScmRequest.getCommandParameters() );
+ }
+
public InfoScmResult info( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters )
throws ScmException
{
Modified: maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java (original)
+++ maven/scm/trunk/maven-scm-api/src/main/java/org/apache/maven/scm/provider/ScmProvider.java Wed Jun 27 19:38:56 2012
@@ -27,6 +27,7 @@ import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTagParameters;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.blame.BlameScmRequest;
import org.apache.maven.scm.command.blame.BlameScmResult;
import org.apache.maven.scm.command.branch.BranchScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
@@ -880,11 +881,23 @@ public interface ScmProvider
* @return blame for specified file
* @throws ScmException
* @since 1.4
+ * @deprecated use blame with {@link BlameScmRequest} parameter
*/
BlameScmResult blame( ScmRepository repository, ScmFileSet fileSet, String filename )
throws ScmException;
/**
+ *
+ * @param blameScmRequest
+ * @return blame for the file specified in the request
+ * @throws ScmException
+ * @since 1.8
+ */
+ BlameScmResult blame( BlameScmRequest blameScmRequest )
+ throws ScmException;
+
+
+ /**
* Create directory/directories in the repository.
*
* @param repository
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameCommand.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameCommand.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameCommand.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameCommand.java Wed Jun 27 19:38:56 2012
@@ -19,8 +19,11 @@ package org.apache.maven.scm.provider.gi
* under the License.
*/
+import org.apache.maven.scm.CommandParameter;
+import org.apache.maven.scm.CommandParameters;
import org.apache.maven.scm.ScmException;
import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmResult;
import org.apache.maven.scm.command.blame.AbstractBlameCommand;
import org.apache.maven.scm.command.blame.BlameScmResult;
import org.apache.maven.scm.provider.ScmProviderRepository;
@@ -40,14 +43,15 @@ public class GitBlameCommand
extends AbstractBlameCommand
implements GitCommand
{
- /**
- * {@inheritDoc}
- */
- public BlameScmResult executeBlameCommand( ScmProviderRepository repo, ScmFileSet workingDirectory,
- String filename )
+
+ @Override
+ protected ScmResult executeCommand( ScmProviderRepository repository, ScmFileSet workingDirectory,
+ CommandParameters parameters )
throws ScmException
{
- Commandline cl = createCommandLine( workingDirectory.getBasedir(), filename );
+ String filename = parameters.getString( CommandParameter.FILE );
+ Commandline cl = createCommandLine( workingDirectory.getBasedir(), filename,
+ parameters.getBoolean( CommandParameter.IGNORE_WHITESPACE, false ) );
GitBlameConsumer consumer = new GitBlameConsumer( getLogger() );
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
@@ -59,11 +63,28 @@ public class GitBlameCommand
return new BlameScmResult( cl.toString(), consumer.getLines() );
}
- public static Commandline createCommandLine( File workingDirectory, String filename )
+ /**
+ * {@inheritDoc}
+ */
+ public BlameScmResult executeBlameCommand( ScmProviderRepository repo, ScmFileSet workingDirectory,
+ String filename )
+ throws ScmException
+ {
+ CommandParameters commandParameters = new CommandParameters();
+ commandParameters.setString( CommandParameter.FILE, filename );
+ commandParameters.setString( CommandParameter.IGNORE_WHITESPACE, Boolean.FALSE.toString() );
+ return (BlameScmResult) execute( repo, workingDirectory, commandParameters );
+ }
+
+ protected static Commandline createCommandLine( File workingDirectory, String filename, boolean ignoreWhitespace )
{
Commandline cl = GitCommandLineUtils.getBaseGitCommandLine( workingDirectory, "blame" );
cl.createArg().setValue( "--porcelain" );
cl.createArg().setValue( filename );
+ if ( ignoreWhitespace )
+ {
+ cl.createArg().setValue( "-w" );
+ }
return cl;
}
}
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumerTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumerTest.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumerTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitBlameConsumerTest.java Wed Jun 27 19:38:56 2012
@@ -48,7 +48,7 @@ public class GitBlameConsumerTest
Assert.assertEquals( 36, consumer.getLines().size() );
- BlameLine blameLine = (BlameLine) consumer.getLines().get( 11 );
+ BlameLine blameLine = consumer.getLines().get( 11 );
Assert.assertEquals( "e670863b2b03e158c59f34af1fee20f91b2bd852", blameLine.getRevision() );
Assert.assertEquals( "Mark Struberg", blameLine.getAuthor() );
Assert.assertNotNull( blameLine.getDate() );
@@ -62,7 +62,7 @@ public class GitBlameConsumerTest
Assert.assertEquals( 187, consumer.getLines().size() );
- BlameLine blameLine = (BlameLine) consumer.getLines().get( 11 );
+ BlameLine blameLine = consumer.getLines().get( 11 );
Assert.assertEquals( "e670863b2b03e158c59f34af1fee20f91b2bd852", blameLine.getRevision() );
Assert.assertEquals( "Mark Struberg", blameLine.getAuthor() );
Assert.assertNotNull( blameLine.getDate() );
@@ -91,7 +91,7 @@ public class GitBlameConsumerTest
GitBlameConsumer consumer = consumeFile( "/src/test/resources/git/blame/git-blame-new-file.out" );
Assert.assertEquals( 3, consumer.getLines().size() );
- BlameLine blameLine = (BlameLine) consumer.getLines().get( 0 );
+ BlameLine blameLine = consumer.getLines().get( 0 );
Assert.assertNotNull( blameLine );
Assert.assertEquals( "0000000000000000000000000000000000000000", blameLine.getRevision() );
Assert.assertEquals( "Not Committed Yet", blameLine.getAuthor() );
@@ -106,13 +106,13 @@ public class GitBlameConsumerTest
GitBlameConsumer consumer = consumeFile( "/src/test/resources/git/blame/git-blame-different-author.out" );
Assert.assertEquals( 93, consumer.getLines().size() );
- BlameLine blameLine = (BlameLine) consumer.getLines().get( 0 );
+ BlameLine blameLine = consumer.getLines().get( 0 );
Assert.assertNotNull( blameLine );
Assert.assertEquals( "39574726d20f62023d39311e6032c7ab0a9d3cdb", blameLine.getRevision() );
Assert.assertEquals( "Mark Struberg", blameLine.getAuthor() );
Assert.assertEquals( "Mark Struberg", blameLine.getCommitter() );
- blameLine = (BlameLine) consumer.getLines().get( 12 );
+ blameLine = consumer.getLines().get( 12 );
Assert.assertNotNull( blameLine );
Assert.assertEquals( "41e5bc05953781a5702f597a1a36c55371b517d3", blameLine.getRevision() );
Assert.assertEquals( "Another User", blameLine.getAuthor() );
Modified: maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitExeBlameCommandTckTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitExeBlameCommandTckTest.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitExeBlameCommandTckTest.java (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/test/java/org/apache/maven/scm/provider/git/gitexe/command/blame/GitExeBlameCommandTckTest.java Wed Jun 27 19:38:56 2012
@@ -48,7 +48,7 @@ public class GitExeBlameCommandTckTest
{
List<BlameLine> lines = result.getLines();
assertEquals( "Expected 1 line in blame", 1, lines.size() );
- BlameLine line = (BlameLine) lines.get( 0 );
+ BlameLine line = lines.get( 0 );
assertEquals( "Mark Struberg", line.getAuthor() );
assertEquals( "92f139dfec4d1dfb79c3cd2f94e83bf13129668b", line.getRevision() );
}
Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java (original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/manager/ScmManagerStub.java Wed Jun 27 19:38:56 2012
@@ -24,6 +24,7 @@ import org.apache.maven.scm.ScmException
import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.blame.BlameScmRequest;
import org.apache.maven.scm.command.blame.BlameScmResult;
import org.apache.maven.scm.command.branch.BranchScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
@@ -53,7 +54,7 @@ import java.util.Date;
import java.util.List;
/**
- * Stub implementation of ScmManager for unit testing purposes.
+ * Stub implementation of ScmManager for unit testing purposes.
* It allows setting the expected results that the different methods will return.
* More information about Stubs on <a href="http://martinfowler.com/bliki/TestDouble.html">Martin Fowler's TestDouble</a>
*
@@ -90,13 +91,17 @@ public class ScmManagerStub
return scmProvider;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public void setScmProvider( String providerType, ScmProvider provider )
{
setScmProvider( provider );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public void setScmProviderImplementation( String providerType, String providerImplementation )
{
//Do nothing there
@@ -132,14 +137,18 @@ public class ScmManagerStub
return messages;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmRepository makeScmRepository( String scmUrl )
throws ScmRepositoryException, NoSuchScmProviderException
{
return getScmRepository();
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmRepository makeProviderScmRepository( String providerType, File path )
throws ScmRepositoryException, UnknownRepositoryStructure, NoSuchScmProviderException
{
@@ -157,42 +166,54 @@ public class ScmManagerStub
return getMessages();
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmProvider getProviderByUrl( String scmUrl )
throws ScmRepositoryException, NoSuchScmProviderException
{
return getScmProvider();
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmProvider getProviderByType( String providerType )
throws NoSuchScmProviderException
{
return getScmProvider();
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ScmProvider getProviderByRepository( ScmRepository repository )
throws NoSuchScmProviderException
{
return getScmProvider();
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public AddScmResult add( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).add( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public AddScmResult add( ScmRepository repository, ScmFileSet fileSet, String message )
throws ScmException
{
return this.getProviderByRepository( repository ).add( repository, fileSet, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings( "deprecation" )
public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName )
throws ScmException
@@ -200,7 +221,9 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings( "deprecation" )
public BranchScmResult branch( ScmRepository repository, ScmFileSet fileSet, String branchName, String message )
throws ScmException
@@ -208,7 +231,9 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).branch( repository, fileSet, branchName, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
int numDays, ScmBranch branch )
throws ScmException
@@ -217,7 +242,9 @@ public class ScmManagerStub
branch );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
int numDays, ScmBranch branch, String datePattern )
throws ScmException
@@ -226,7 +253,9 @@ public class ScmManagerStub
branch, datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ChangeLogScmRequest request )
throws ScmException
{
@@ -234,7 +263,9 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).changeLog( request );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion,
ScmVersion endVersion )
throws ScmException
@@ -242,7 +273,9 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).changeLog( repository, fileSet, startVersion, endVersion );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, ScmVersion startRevision,
ScmVersion endRevision, String datePattern )
throws ScmException
@@ -251,42 +284,54 @@ public class ScmManagerStub
datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, String message )
throws ScmException
{
return this.getProviderByRepository( repository ).checkIn( repository, fileSet, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckInScmResult checkIn( ScmRepository repository, ScmFileSet fileSet, ScmVersion revision, String message )
throws ScmException
{
return this.getProviderByRepository( repository ).checkIn( repository, fileSet, revision, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).checkOut( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
throws ScmException
{
return this.getProviderByRepository( repository ).checkOut( repository, fileSet, version );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, boolean recursive )
throws ScmException
{
return this.getProviderByRepository( repository ).checkOut( repository, fileSet, recursive );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public CheckOutScmResult checkOut( ScmRepository repository, ScmFileSet fileSet, ScmVersion version,
boolean recursive )
throws ScmException
@@ -294,7 +339,9 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).checkOut( repository, fileSet, version, recursive );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public DiffScmResult diff( ScmRepository repository, ScmFileSet fileSet, ScmVersion startVersion,
ScmVersion endVersion )
throws ScmException
@@ -302,35 +349,45 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).diff( repository, fileSet, startVersion, endVersion );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public EditScmResult edit( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).edit( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).export( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
throws ScmException
{
return this.getProviderByRepository( repository ).export( repository, fileSet, version );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, String outputDirectory )
throws ScmException
{
return this.export( repository, fileSet, outputDirectory );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ExportScmResult export( ScmRepository repository, ScmFileSet fileSet, ScmVersion version,
String outputDirectory )
throws ScmException
@@ -338,28 +395,36 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).export( repository, fileSet, version, outputDirectory );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public ListScmResult list( ScmRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version )
throws ScmException
{
return this.getProviderByRepository( repository ).list( repository, fileSet, recursive, version );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public RemoveScmResult remove( ScmRepository repository, ScmFileSet fileSet, String message )
throws ScmException
{
return this.getProviderByRepository( repository ).remove( repository, fileSet, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public StatusScmResult status( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).status( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings( "deprecation" )
public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName )
throws ScmException
@@ -367,7 +432,9 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
@SuppressWarnings( "deprecation" )
public TagScmResult tag( ScmRepository repository, ScmFileSet fileSet, String tagName, String message )
throws ScmException
@@ -375,35 +442,45 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).tag( repository, fileSet, tagName, message );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UnEditScmResult unedit( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).unedit( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, version );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, boolean runChangelog )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, runChangelog );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version,
boolean runChangelog )
throws ScmException
@@ -411,14 +488,18 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).update( repository, fileSet, version, runChangelog );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, String datePattern )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version,
String datePattern )
throws ScmException
@@ -426,21 +507,27 @@ public class ScmManagerStub
return this.getProviderByRepository( repository ).update( repository, fileSet, version, datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, (ScmVersion) null, lastUpdate );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate )
throws ScmException
{
return this.getProviderByRepository( repository ).update( repository, fileSet, version, lastUpdate );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, Date lastUpdate, String datePattern )
throws ScmException
{
@@ -448,7 +535,9 @@ public class ScmManagerStub
datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public UpdateScmResult update( ScmRepository repository, ScmFileSet fileSet, ScmVersion version, Date lastUpdate,
String datePattern )
throws ScmException
@@ -457,17 +546,27 @@ public class ScmManagerStub
datePattern );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public BlameScmResult blame( ScmRepository repository, ScmFileSet fileSet, String filename )
throws ScmException
{
return this.getProviderByRepository( repository ).blame( repository, fileSet, filename );
}
- /** {@inheritDoc} */
+ public BlameScmResult blame( BlameScmRequest blameScmRequest )
+ throws ScmException
+ {
+ return this.getProviderByRepository( blameScmRequest.getScmRepository() ).blame( blameScmRequest );
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public MkdirScmResult mkdir( ScmRepository repository, ScmFileSet fileSet, String message, boolean createInLocal )
throws ScmException
- {
+ {
return this.getProviderByRepository( repository ).mkdir( repository, fileSet, message, createInLocal );
}
}
Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java (original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/provider/ScmProviderStub.java Wed Jun 27 19:38:56 2012
@@ -28,6 +28,7 @@ import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTagParameters;
import org.apache.maven.scm.ScmVersion;
import org.apache.maven.scm.command.add.AddScmResult;
+import org.apache.maven.scm.command.blame.BlameScmRequest;
import org.apache.maven.scm.command.blame.BlameScmResult;
import org.apache.maven.scm.command.branch.BranchScmResult;
import org.apache.maven.scm.command.changelog.ChangeLogScmRequest;
@@ -865,6 +866,12 @@ public class ScmProviderStub
return getBlameScmResult();
}
+ public BlameScmResult blame( BlameScmRequest blameScmRequest )
+ throws ScmException
+ {
+ return getBlameScmResult();
+ }
+
/**
* {@inheritDoc}
*/
Modified: maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/blame/BlameCommandTckTest.java
URL: http://svn.apache.org/viewvc/maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/blame/BlameCommandTckTest.java?rev=1354687&r1=1354686&r2=1354687&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/blame/BlameCommandTckTest.java (original)
+++ maven/scm/trunk/maven-scm-test/src/main/java/org/apache/maven/scm/tck/command/blame/BlameCommandTckTest.java Wed Jun 27 19:38:56 2012
@@ -23,6 +23,7 @@ import org.apache.maven.scm.ScmFileSet;
import org.apache.maven.scm.ScmTckTestCase;
import org.apache.maven.scm.ScmTestCase;
import org.apache.maven.scm.command.blame.BlameLine;
+import org.apache.maven.scm.command.blame.BlameScmRequest;
import org.apache.maven.scm.command.blame.BlameScmResult;
import org.apache.maven.scm.command.checkin.CheckInScmResult;
import org.apache.maven.scm.manager.ScmManager;
@@ -51,7 +52,10 @@ public abstract class BlameCommandTckTes
BlameLine line;
// === readme.txt ===
- result = manager.blame( repository, fileSet, "readme.txt" );
+ BlameScmRequest blameScmRequest = new BlameScmRequest( repository, fileSet );
+ blameScmRequest.setFilename( "readme.txt" );
+ //result = manager.blame( repository, fileSet, "readme.txt" );
+ result = manager.blame( blameScmRequest );
assertNotNull( "The command returned a null result.", result );
assertResultIsSuccess( result );
assertEquals( "Expected 1 line in blame", 1, result.getLines().size() );