Search in sources :

Example 16 with TagScmResult

use of org.apache.maven.scm.command.tag.TagScmResult in project maven-scm by apache.

the class StarteamScmProvider method tag.

/**
 * {@inheritDoc}
 */
public TagScmResult tag(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
    fileSet = fixUpScmFileSetAbsoluteFilePath(fileSet);
    StarteamTagCommand command = new StarteamTagCommand();
    command.setLogger(getLogger());
    return (TagScmResult) command.execute(repository, fileSet, parameters);
}
Also used : TagScmResult(org.apache.maven.scm.command.tag.TagScmResult) StarteamTagCommand(org.apache.maven.scm.provider.starteam.command.tag.StarteamTagCommand)

Example 17 with TagScmResult

use of org.apache.maven.scm.command.tag.TagScmResult in project maven-scm by apache.

the class AccuRevTagCommandTest method testTag.

@Test
public void testTag() throws Exception {
    final ScmFileSet testFileSet = new ScmFileSet(new File("/my/workspace/project/dir"));
    final File basedir = testFileSet.getBasedir();
    final String basisStream = "basisStream";
    final AccuRevInfo info = new AccuRevInfo(basedir);
    info.setBasis(basisStream);
    AccuRevScmProviderRepository repo = new AccuRevScmProviderRepository();
    repo.setStreamName("myStream");
    repo.setAccuRev(accurev);
    repo.setProjectPath("/project/dir");
    when(accurev.info(basedir)).thenReturn(info);
    when(accurev.mksnap("theTagName", basisStream)).thenReturn(Boolean.TRUE);
    List<File> taggedFiles = Collections.singletonList(new File("tagged/file"));
    when(accurev.statTag("theTagName")).thenReturn(taggedFiles);
    AccuRevTagCommand command = new AccuRevTagCommand(getLogger());
    CommandParameters commandParameters = new CommandParameters();
    commandParameters.setString(CommandParameter.TAG_NAME, "theTagName");
    TagScmResult result = command.tag(repo, testFileSet, commandParameters);
    assertThat(result.isSuccess(), is(true));
    assertThat(result.getTaggedFiles().size(), is(1));
    assertHasScmFile(result.getTaggedFiles(), "tagged/file", ScmFileStatus.TAGGED);
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) AccuRevScmProviderRepository(org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository) CommandParameters(org.apache.maven.scm.CommandParameters) TagScmResult(org.apache.maven.scm.command.tag.TagScmResult) File(java.io.File) ScmFileMatcher.assertHasScmFile(org.apache.maven.scm.ScmFileMatcher.assertHasScmFile) AccuRevInfo(org.apache.maven.scm.provider.accurev.AccuRevInfo) Test(org.junit.Test) AbstractAccuRevCommandTest(org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommandTest)

Example 18 with TagScmResult

use of org.apache.maven.scm.command.tag.TagScmResult in project maven-scm by apache.

the class AccuRevTagCommandTckTest method testReleasePluginStyleTagThenCheckout.

@SuppressWarnings("deprecation")
@Test
public void testReleasePluginStyleTagThenCheckout() throws Exception {
    String tag = "test-tag";
    makeFile(getWorkingCopy(), ".acignore", "target/*\ntarget\n");
    ScmRepository scmRepository = getScmRepository();
    addToWorkingTree(getWorkingCopy(), new File(".acignore"), scmRepository);
    CheckInScmResult checkinResult = getScmManager().checkIn(scmRepository, new ScmFileSet(getWorkingCopy()), "add acignore");
    assertResultIsSuccess(checkinResult);
    TagScmResult tagResult = getScmManager().getProviderByUrl(getScmUrl()).tag(scmRepository, new ScmFileSet(getWorkingCopy()), tag);
    assertResultIsSuccess(tagResult);
    scmRepository.getProviderRepository().setPersistCheckout(false);
    CheckOutScmResult checkoutResult = getScmManager().checkOut(scmRepository, new ScmFileSet(new File(getWorkingCopy(), "target/checkout")), new ScmTag(tag));
    assertResultIsSuccess(checkoutResult);
}
Also used : ScmRepository(org.apache.maven.scm.repository.ScmRepository) ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmTag(org.apache.maven.scm.ScmTag) CheckOutScmResult(org.apache.maven.scm.command.checkout.CheckOutScmResult) TagScmResult(org.apache.maven.scm.command.tag.TagScmResult) File(java.io.File) CheckInScmResult(org.apache.maven.scm.command.checkin.CheckInScmResult) Test(org.junit.Test) TagCommandTckTest(org.apache.maven.scm.tck.command.tag.TagCommandTckTest)

Example 19 with TagScmResult

use of org.apache.maven.scm.command.tag.TagScmResult in project maven-scm by apache.

the class BazaarScmProvider method tag.

/**
 * {@inheritDoc}
 */
public TagScmResult tag(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
    BazaarTagCommand command = new BazaarTagCommand();
    command.setLogger(getLogger());
    return (TagScmResult) command.execute(repository, fileSet, parameters);
}
Also used : BazaarTagCommand(org.apache.maven.scm.provider.bazaar.command.tag.BazaarTagCommand) TagScmResult(org.apache.maven.scm.command.tag.TagScmResult)

Example 20 with TagScmResult

use of org.apache.maven.scm.command.tag.TagScmResult in project maven-scm by apache.

the class VssScmProvider method tag.

public TagScmResult tag(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
    VssTagCommand command = new VssTagCommand();
    command.setLogger(getLogger());
    return (TagScmResult) command.execute(repository, fileSet, parameters);
}
Also used : VssTagCommand(org.apache.maven.scm.provider.vss.commands.tag.VssTagCommand) TagScmResult(org.apache.maven.scm.command.tag.TagScmResult)

Aggregations

TagScmResult (org.apache.maven.scm.command.tag.TagScmResult)32 File (java.io.File)12 ScmException (org.apache.maven.scm.ScmException)11 ArrayList (java.util.ArrayList)6 ScmFile (org.apache.maven.scm.ScmFile)6 CommandLineUtils (org.codehaus.plexus.util.cli.CommandLineUtils)6 Commandline (org.codehaus.plexus.util.cli.Commandline)5 ScmFileSet (org.apache.maven.scm.ScmFileSet)4 IOException (java.io.IOException)3 CheckOutScmResult (org.apache.maven.scm.command.checkout.CheckOutScmResult)3 AccuRevInfo (org.apache.maven.scm.provider.accurev.AccuRevInfo)3 CommandParameters (org.apache.maven.scm.CommandParameters)2 ScmFileMatcher.assertHasScmFile (org.apache.maven.scm.ScmFileMatcher.assertHasScmFile)2 ScmResult (org.apache.maven.scm.ScmResult)2 ScmTag (org.apache.maven.scm.ScmTag)2 ScmTagParameters (org.apache.maven.scm.ScmTagParameters)2 CheckInScmResult (org.apache.maven.scm.command.checkin.CheckInScmResult)2 AccuRevScmProviderRepository (org.apache.maven.scm.provider.accurev.AccuRevScmProviderRepository)2 AbstractAccuRevCommandTest (org.apache.maven.scm.provider.accurev.command.AbstractAccuRevCommandTest)2 CvsTagConsumer (org.apache.maven.scm.provider.cvslib.command.tag.CvsTagConsumer)2