1 package org.apache.maven.scm.provider.hg.command.status;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.File;
23
24 import org.apache.maven.scm.ScmException;
25 import org.apache.maven.scm.ScmFileSet;
26 import org.apache.maven.scm.ScmResult;
27 import org.apache.maven.scm.command.Command;
28 import org.apache.maven.scm.command.status.AbstractStatusCommand;
29 import org.apache.maven.scm.command.status.StatusScmResult;
30 import org.apache.maven.scm.provider.ScmProviderRepository;
31 import org.apache.maven.scm.provider.hg.HgUtils;
32 import org.apache.maven.scm.provider.hg.command.HgCommandConstants;
33
34
35
36
37 public class HgStatusCommand
38 extends AbstractStatusCommand
39 implements Command
40 {
41
42 public HgStatusCommand()
43 {
44 super();
45 }
46
47
48 public StatusScmResult executeStatusCommand( ScmProviderRepository repo, ScmFileSet fileSet )
49 throws ScmException
50 {
51
52 File workingDir = fileSet.getBasedir();
53 HgStatusConsumer consumer = new HgStatusConsumer( getLogger(), workingDir );
54 String[] statusCmd = new String[] { HgCommandConstants.STATUS_CMD };
55 ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, statusCmd );
56
57 return new StatusScmResult( consumer.getStatus(), result );
58 }
59 }