1 | |
package org.apache.maven.scm.provider.bazaar.command.add; |
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.add.AbstractAddCommand; |
29 | |
import org.apache.maven.scm.command.add.AddScmResult; |
30 | |
import org.apache.maven.scm.provider.ScmProviderRepository; |
31 | |
import org.apache.maven.scm.provider.bazaar.BazaarUtils; |
32 | |
import org.apache.maven.scm.provider.bazaar.command.BazaarConstants; |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | 0 | public class BazaarAddCommand |
41 | |
extends AbstractAddCommand |
42 | |
implements Command |
43 | |
{ |
44 | |
|
45 | |
protected ScmResult executeAddCommand( ScmProviderRepository repo, ScmFileSet fileSet, String message, |
46 | |
boolean binary ) |
47 | |
throws ScmException |
48 | |
{ |
49 | 0 | String[] addCmd = new String[]{BazaarConstants.ADD_CMD, BazaarConstants.NO_RECURSE_OPTION}; |
50 | 0 | addCmd = BazaarUtils.expandCommandLine( addCmd, fileSet ); |
51 | |
|
52 | 0 | File workingDir = fileSet.getBasedir(); |
53 | 0 | BazaarAddConsumer consumer = new BazaarAddConsumer( getLogger(), workingDir ); |
54 | 0 | ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDir, addCmd ); |
55 | |
|
56 | 0 | return new AddScmResult( consumer.getAddedFiles(), result ); |
57 | |
} |
58 | |
} |