All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.scm.RevisionParameterAction Maven / Gradle / Ivy

package hudson.scm;

import hudson.model.InvisibleAction;
import hudson.scm.SubversionSCM.SvnInfo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.tmatesoft.svn.core.wc.SVNRevision;

/**
 * Action containing a list of SVN revisions that should be checked out. Used for parameterized builds.
 * 
 * @author Tom Huybrechts
 */
public class RevisionParameterAction extends InvisibleAction {
	
	private final List revisions;

	public RevisionParameterAction(List revisions) {
		super();
		this.revisions = revisions;
	}
	
	public RevisionParameterAction(SvnInfo... revisions) {
		this.revisions = new ArrayList(Arrays.asList(revisions));
	}

	public List getRevisions() {
		return revisions;
	}
	
	public SVNRevision getRevision(String url) {
		for (SvnInfo revision: revisions) {
			if (revision.url.equals(url)) {
				return SVNRevision.create(revision.revision);
			}
		}
		return null;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy