Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
SONARSCSVN-6 Blame working revision
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed Aug 3, 2015
1 parent 231a4f5 commit 6439871
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main/java/org/sonar/plugins/scm/svn/SvnBlameCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
package org.sonar.plugins.scm.svn;

import java.util.List;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.scm.BlameCommand;
Expand All @@ -28,9 +29,15 @@
import org.tmatesoft.svn.core.SVNErrorCode;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.wc.*;

import java.util.List;
import org.tmatesoft.svn.core.wc.ISVNOptions;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNDiffOptions;
import org.tmatesoft.svn.core.wc.SVNLogClient;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNStatus;
import org.tmatesoft.svn.core.wc.SVNStatusClient;
import org.tmatesoft.svn.core.wc.SVNStatusType;
import org.tmatesoft.svn.core.wc.SVNWCUtil;

public class SvnBlameCommand extends BlameCommand {

Expand Down Expand Up @@ -83,7 +90,7 @@ private void blame(SVNClientManager clientManager, FileSystem fs, InputFile inpu
}
SVNLogClient logClient = clientManager.getLogClient();
logClient.setDiffOptions(new SVNDiffOptions(true, true, true));
logClient.doAnnotate(inputFile.file(), SVNRevision.UNDEFINED, SVNRevision.create(1), SVNRevision.HEAD, true, true, handler, null);
logClient.doAnnotate(inputFile.file(), SVNRevision.UNDEFINED, SVNRevision.create(1), SVNRevision.WORKING, true, true, handler, null);
} catch (SVNException e) {
throw new IllegalStateException("Error when executing blame for file " + filename, e);
}
Expand Down

0 comments on commit 6439871

Please sign in to comment.