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