Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright (C) 2011 JFrog Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jfrog.hudson.release.scm.svn;
Subversion scm coordinator. Interacts with the SubversionManager to fulfill the release process.

Author(s):
Yossi Shaul
    private SubversionManager scmManager;
    private boolean tagCreated;
    private final ReleaseAction releaseAction;
    public SubversionCoordinator(AbstractBuild buildBuildListener listenerReleaseAction releaseAction) {
        super(buildlistener);
        this. = releaseAction;
    }
    public void prepare() throws IOExceptionInterruptedException {
         = new SubversionManager();
    }
        if (.isCreateVcsTag()) {
             = true;
        }
    }
    public void beforeDevelopmentVersionChange() {
        // nothing special for svn
    }
    @Override
    public void afterDevelopmentVersionChange(boolean modifiedthrows IOExceptionInterruptedException {
        super.afterDevelopmentVersionChange(modified);
        if (modified) {
        }
    }
    public void buildCompleted() throws IOExceptionInterruptedException {
        if (.getResult().isWorseThan(.)) {
            // build has failed, make sure to delete the tag and revert the working copy
            //run.getActions().remove(releaseBadge);
            .safeRevertWorkingCopy();
            if () {
                .safeRevertTag(.getTagUrl(), getRevertTagMessage());
            }
        }
    }

    

Returns:
The message to delete the tag with, if the user has inputted a custom message to commit the tag, then a Reverting: message will prepended to the custom message to use when deleting the tag. Otherwise, the default message will be used.
    private String getRevertTagMessage() {
        String tagComment = .getDefaultVcsConfig().getTagComment();
        if (StringUtils.equals(.getTagComment(), tagComment)) {
            return tagComment;
        }
        return . + "Reverting: " + .getTagComment();
    }
    public String getRemoteUrlForPom() {
        return .getRemoteUrl();
    }
New to GrepCode? Check out our FAQ X