1 package org.apache.maven.scm.provider.hg.command.blame;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.scm.ScmException;
23 import org.apache.maven.scm.ScmFileSet;
24 import org.apache.maven.scm.ScmResult;
25 import org.apache.maven.scm.command.blame.AbstractBlameCommand;
26 import org.apache.maven.scm.command.blame.BlameScmResult;
27 import org.apache.maven.scm.provider.ScmProviderRepository;
28 import org.apache.maven.scm.provider.hg.HgUtils;
29
30
31
32
33
34
35 public class HgBlameCommand
36 extends AbstractBlameCommand
37 {
38 public static final String BLAME_CMD = "blame";
39
40
41
42
43 public BlameScmResult executeBlameCommand( ScmProviderRepository repo, ScmFileSet workingDirectory,
44 String filename )
45 throws ScmException
46 {
47 String[] cmd = new String[]{ BLAME_CMD, "--user",
48 "--date",
49 "--changeset",
50 filename };
51 HgBlameConsumer consumer = new HgBlameConsumer( getLogger() );
52 ScmResult result = HgUtils.execute( consumer, getLogger(), workingDirectory.getBasedir(), cmd );
53 return new BlameScmResult( consumer.getLines(), result );
54 }
55 }