SonarCommunity/sonar-scm-activity — pull request #1 by earthling (2013-02-06 21:33:48+00:00)
Title: Support for p4maven scm provider

Hello - I work for a company that uses perforce. We've come to the end of our rope using the 'perforce' scm provider and have switched to the 'p4maven' provider. This provider is 100% java (doesn't need the p4 executable), handles authentication much better and is provided by Perforce themselves. I had to make a small tweak to the scm activity plugin to allow it to use this scm provider.

I also had to make a small change to p4maven's "blame" command implementation. The signature of the blame command looks like this:
```java
public abstract BlameScmResult executeBlameCommand(
ScmProviderRepository repo,
ScmFileSet workingDirectory,
String filename ) throws ScmException;
```
But for whatever reason, the p4maven command was not correctly formulating the complete filename from the given arguments (it was just using the relative filename and ignoring the workingDirectory argument). So, without this small fix in p4maven, the blame command won't work correctly...

But I think the scm activity plugin could work around the issue by passing the absolute path in, e.g.:
```java
public BlameScmResult blame(File file) throws ScmException {
String fileName = isP4MavenProvider() ? file.getAbsolutePath() : file.getName();
return scmManager.blame(getScmRepository(), new ScmFileSet(file.getParentFile()), fileName);
}
```
Or something of that sort?