1 | |
package org.apache.maven.scm.provider.cvslib.cvsexe.command.branch; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import org.apache.maven.scm.ScmException; |
23 | |
import org.apache.maven.scm.command.branch.BranchScmResult; |
24 | |
import org.apache.maven.scm.provider.cvslib.command.branch.AbstractCvsBranchCommand; |
25 | |
import org.apache.maven.scm.provider.cvslib.command.branch.CvsBranchConsumer; |
26 | |
import org.codehaus.plexus.util.cli.CommandLineException; |
27 | |
import org.codehaus.plexus.util.cli.CommandLineUtils; |
28 | |
import org.codehaus.plexus.util.cli.Commandline; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | 0 | public class CvsExeBranchCommand |
36 | |
extends AbstractCvsBranchCommand |
37 | |
{ |
38 | |
|
39 | |
protected BranchScmResult executeCvsCommand( Commandline cl ) |
40 | |
throws ScmException |
41 | |
{ |
42 | |
int exitCode; |
43 | |
|
44 | 0 | CvsBranchConsumer consumer = new CvsBranchConsumer( getLogger() ); |
45 | |
|
46 | 0 | CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer(); |
47 | |
|
48 | |
try |
49 | |
{ |
50 | 0 | exitCode = CommandLineUtils.executeCommandLine( cl, consumer, stderr ); |
51 | |
} |
52 | 0 | catch ( CommandLineException ex ) |
53 | |
{ |
54 | 0 | throw new ScmException( "Error while executing command.", ex ); |
55 | 0 | } |
56 | |
|
57 | 0 | if ( exitCode != 0 ) |
58 | |
{ |
59 | 0 | return new BranchScmResult( cl.toString(), "The cvs branch command failed.", stderr.getOutput(), false ); |
60 | |
} |
61 | |
|
62 | 0 | return new BranchScmResult( cl.toString(), consumer.getTaggedFiles() ); |
63 | |
|
64 | |
} |
65 | |
} |