jenkins.plugins.svnmerge
Class FeatureBranchProperty

java.lang.Object
  extended by hudson.model.JobProperty<hudson.model.AbstractProject<?,?>>
      extended by jenkins.plugins.svnmerge.FeatureBranchProperty
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.model.JobProperty<?>>, hudson.model.ReconfigurableDescribable<hudson.model.JobProperty<?>>, hudson.tasks.BuildStep

public class FeatureBranchProperty
extends hudson.model.JobProperty<hudson.model.AbstractProject<?,?>>

JobProperty for feature branch projects.

This associates the upstream project (with IntegratableProject with this project.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class FeatureBranchProperty.DescriptorImpl
           
static class FeatureBranchProperty.ItemListenerImpl
          If an upstream is renamed, update the configuration accordingly.
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.model.JobProperty
owner
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
FeatureBranchProperty(java.lang.String upstream)
           
 
Method Summary
 java.util.List<hudson.model.Action> getJobActions(hudson.model.AbstractProject<?,?> project)
           
 hudson.model.AbstractProject<?,?> getOwner()
           
 java.lang.String getUpstream()
           
 hudson.model.AbstractProject<?,?> getUpstreamProject()
          Gets the upstream project, or null if no such project was found.
 hudson.scm.SubversionSCM.ModuleLocation getUpstreamSubversionLocation()
           
 org.tmatesoft.svn.core.SVNURL getUpstreamURL()
          Gets the getUpstreamSubversionLocation() as SVNURL
 long integrate(hudson.model.TaskListener listener, java.lang.String branchURL, long branchRev, java.lang.String commitMessage)
          Perform a merge to the upstream that integrates changes in this branch.
 boolean prebuild(hudson.model.AbstractBuild<?,?> build, hudson.model.BuildListener listener)
          Just add the integration action.
 long rebase(hudson.model.TaskListener listener, long upstreamRev)
          Integrates changes made in the upstream into the branch at the workspace.
 
Methods inherited from class hudson.model.JobProperty
getDescriptor, getJobAction, getJobOverrides, getProjectAction, getProjectActions, getRequiredMonitorService, getSubTasks, perform, reconfigure, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureBranchProperty

@DataBoundConstructor
public FeatureBranchProperty(java.lang.String upstream)
Method Detail

getUpstream

public java.lang.String getUpstream()

getUpstreamProject

public hudson.model.AbstractProject<?,?> getUpstreamProject()
Gets the upstream project, or null if no such project was found.


getUpstreamSubversionLocation

public hudson.scm.SubversionSCM.ModuleLocation getUpstreamSubversionLocation()

getUpstreamURL

public org.tmatesoft.svn.core.SVNURL getUpstreamURL()
                                             throws org.tmatesoft.svn.core.SVNException
Gets the getUpstreamSubversionLocation() as SVNURL

Throws:
org.tmatesoft.svn.core.SVNException

getOwner

public hudson.model.AbstractProject<?,?> getOwner()

getJobActions

public java.util.List<hudson.model.Action> getJobActions(hudson.model.AbstractProject<?,?> project)
Overrides:
getJobActions in class hudson.model.JobProperty<hudson.model.AbstractProject<?,?>>

prebuild

public boolean prebuild(hudson.model.AbstractBuild<?,?> build,
                        hudson.model.BuildListener listener)
Just add the integration action.

Specified by:
prebuild in interface hudson.tasks.BuildStep
Overrides:
prebuild in class hudson.model.JobProperty<hudson.model.AbstractProject<?,?>>

rebase

public long rebase(hudson.model.TaskListener listener,
                   long upstreamRev)
            throws java.io.IOException,
                   java.lang.InterruptedException
Integrates changes made in the upstream into the branch at the workspace.

This computation uses the workspace of the project. First, we update the workspace to the tip of the branch (or else the commit will fail later), merge the changes from the upstream, then commit it. If the merge fails, we'll revert the workspace so that the next build can go smoothly.

Parameters:
listener - Where the progress is sent.
upstreamRev - Revision of the upstream to rebase from. If -1, use the latest.
Returns:
the new revision number if the rebase was successful. -1 if it failed and the failure was handled gracefully (typically this means a merge conflict.)
Throws:
java.io.IOException
java.lang.InterruptedException

integrate

public long integrate(hudson.model.TaskListener listener,
                      java.lang.String branchURL,
                      long branchRev,
                      java.lang.String commitMessage)
               throws java.io.IOException,
                      java.lang.InterruptedException
Perform a merge to the upstream that integrates changes in this branch.

This computation uses the workspace of the project.

Parameters:
listener - Where the progress is sent.
branchURL - URL of the branch to be integrated. If null, use the workspace URL.
branchRev - Revision of the branch to be integrated to the upstream. If -1, use the current workspace revision.
Returns:
the new revision number if the integration was successful. -1 if it failed and the failure was handled gracefully (typically this means a merge conflict.)
Throws:
java.io.IOException
java.lang.InterruptedException


Copyright © 2004-2011. All Rights Reserved.