1 | |
package org.apache.maven.scm.provider.cvslib.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.ScmFileSet; |
24 | |
import org.apache.maven.scm.ScmResult; |
25 | |
import org.apache.maven.scm.command.branch.AbstractBranchCommand; |
26 | |
import org.apache.maven.scm.command.branch.BranchScmResult; |
27 | |
import org.apache.maven.scm.provider.ScmProviderRepository; |
28 | |
import org.apache.maven.scm.provider.cvslib.command.CvsCommand; |
29 | |
import org.apache.maven.scm.provider.cvslib.command.CvsCommandUtils; |
30 | |
import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; |
31 | |
import org.codehaus.plexus.util.cli.Commandline; |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | 0 | public abstract class AbstractCvsBranchCommand |
38 | |
extends AbstractBranchCommand |
39 | |
implements CvsCommand |
40 | |
{ |
41 | |
|
42 | |
protected ScmResult executeBranchCommand( ScmProviderRepository repo, ScmFileSet fileSet, String branchName, |
43 | |
String message ) |
44 | |
throws ScmException |
45 | |
{ |
46 | 0 | CvsScmProviderRepository repository = (CvsScmProviderRepository) repo; |
47 | |
|
48 | 0 | Commandline cl = CvsCommandUtils.getBaseCommand( "tag", repository, fileSet, false ); |
49 | |
|
50 | 0 | cl.createArg().setValue( "-b" ); |
51 | |
|
52 | 0 | cl.createArg().setValue( "-F" ); |
53 | |
|
54 | 0 | cl.createArg().setValue( "-c" ); |
55 | |
|
56 | 0 | cl.createArg().setValue( branchName ); |
57 | |
|
58 | 0 | if ( getLogger().isInfoEnabled() ) |
59 | |
{ |
60 | 0 | getLogger().info( "Executing: " + cl ); |
61 | 0 | getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() ); |
62 | |
} |
63 | |
|
64 | 0 | return executeCvsCommand( cl ); |
65 | |
} |
66 | |
|
67 | |
protected abstract BranchScmResult executeCvsCommand( Commandline cl ) |
68 | |
throws ScmException; |
69 | |
} |