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
37 public class HgRemoveCommand extends AbstractRemoveCommand implements Command {
38
39 protected ScmResult executeRemoveCommand(ScmProviderRepository repository, ScmFileSet fileSet, String message)
40 throws ScmException {
41
42 String[] command = new String[] {HgCommandConstants.REMOVE_CMD};
43 command = HgUtils.expandCommandLine(command, fileSet);
44
45 File workingDir = fileSet.getBasedir();
46 HgRemoveConsumer consumer = new HgRemoveConsumer(workingDir);
47
48 ScmResult result = HgUtils.execute(consumer, workingDir, command);
49 return new RemoveScmResult(consumer.getRemovedFiles(), result);
50 }
51 }