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.remove;
20
21 import java.io.File;
22
23 import org.apache.maven.scm.ScmException;
24 import org.apache.maven.scm.ScmFileSet;
25 import org.apache.maven.scm.ScmResult;
26 import org.apache.maven.scm.command.Command;
27 import org.apache.maven.scm.command.remove.AbstractRemoveCommand;
28 import org.apache.maven.scm.command.remove.RemoveScmResult;
29 import org.apache.maven.scm.provider.ScmProviderRepository;
30 import org.apache.maven.scm.provider.hg.HgUtils;
31 import org.apache.maven.scm.provider.hg.command.HgCommandConstants;
32
33
34
35
36 public class HgRemoveCommand extends AbstractRemoveCommand implements Command {
37
38
39
40 protected ScmResult executeRemoveCommand(ScmProviderRepository repository, ScmFileSet fileSet, String message)
41 throws ScmException {
42
43 String[] command = new String[] {HgCommandConstants.REMOVE_CMD};
44 command = HgUtils.expandCommandLine(command, fileSet);
45
46 File workingDir = fileSet.getBasedir();
47 HgRemoveConsumer consumer = new HgRemoveConsumer(workingDir);
48
49 ScmResult result = HgUtils.execute(consumer, workingDir, command);
50 return new RemoveScmResult(consumer.getRemovedFiles(), result);
51 }
52 }