public class MercurialBackend extends Object
| Modifier and Type | Field and Description |
|---|---|
protected hudson.FilePath |
repoPath
Path to the repository folder
|
| Constructor and Description |
|---|
MercurialBackend(hudson.model.AbstractBuild build,
hudson.Launcher launcher,
hudson.model.BuildListener listener,
hudson.plugins.mercurial.MercurialSCM scm)
Please do not instantiate objects of this class yourself, use SCMManagerFactory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clean()
Cleans workspace from artifacts.
|
void |
closeBranch(String branch,
String message,
String username)
Close given branch
|
void |
commit(String message,
String username)
Commit current workspace.
|
void |
createFile(String filename,
String content)
Create file in the repository folder
|
ReleaseBranch |
createReleaseBranch(String branch,
String releaseFilePath,
String releaseFileContent,
String message,
String username)
Create the release branch.
|
void |
ensureReleaseBranch(String branch,
String releaseFilePath,
String releaseFileContent,
String message,
String username)
Ensure the release branch exists.
|
String |
getBranch()
Get the current branch name in the workspace.
|
List<Branch> |
getBranches(boolean all)
Get Mercurial branches from command line output,
and put them in a List with Branches so it's nice to work with.
|
List<String> |
getBranchNames(boolean all)
Get open Mercurial branches from command line output,
and put them in a List so it's nice to work with.
|
ReleaseBranch |
getReleaseBranch(String branch)
Get release branch from given branch name.
|
void |
mergeHeads(String message,
String username)
Merge possible current branch's heads.
|
void |
mergeWorkspaceWith(String revision,
String updateTo)
Merge current workspace with given revision.
|
void |
pull()
Executes 'pull' command
|
void |
pull(String remote)
Pulls changes from remotes.
|
void |
pull(String remote,
String branch)
Pulls from given repository url.
|
void |
push(String... branchNames)
Executes 'push' command with -b
|
void |
stripLocal()
Strip out local commits which are not pushed yet.
|
void |
update(String revision)
Updates workspace to given revision/branch.
|
void |
updateClean(String revision)
Updates workspace to given revision/branch with cleaning.
|
public MercurialBackend(hudson.model.AbstractBuild build,
hudson.Launcher launcher,
hudson.model.BuildListener listener,
hudson.plugins.mercurial.MercurialSCM scm)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic List<Branch> getBranches(boolean all)
AdvancedSCMManagergetBranches in interface AdvancedSCMManagerall - : get all or only open branchespublic String getBranch() throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void update(String revision) throws AdvancedSCMException
AdvancedSCMManagerrevision - : String with revision, hash of branchname to update to.AdvancedSCMExceptionpublic void updateClean(String revision) throws AdvancedSCMException
AdvancedSCMManagerrevision - : String with revision, hash of branchname to update to.AdvancedSCMExceptionpublic void stripLocal()
throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void clean()
throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void closeBranch(String branch, String message, String username) throws AdvancedSCMException
AdvancedSCMManagermessage - : String with message to give this commit.username - : String commit user name (with email)AdvancedSCMExceptionpublic void mergeWorkspaceWith(String revision, String updateTo) throws AdvancedSCMException
AdvancedSCMManagerrevision - : String with revision, hash or branchname to merge with.updateTo - : String with revision, hash or branchname to update working copy to before actual merge.AdvancedSCMExceptionpublic void mergeHeads(String message, String username) throws AdvancedSCMException
AdvancedSCMManagermessage - : String commit messageusername - : String commit user name (with email)AdvancedSCMExceptionpublic void commit(String message, String username) throws AdvancedSCMException
AdvancedSCMManagermessage - : String commit messageusername - : String commit user name (with email)AdvancedSCMExceptionpublic void push(String... branchNames) throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void pull()
throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void pull(String remote) throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic void pull(String remote, String branch) throws AdvancedSCMException
AdvancedSCMManagerAdvancedSCMExceptionpublic ReleaseBranch getReleaseBranch(String branch) throws ReleaseBranchInvalidException
AdvancedSCMManagerbranch - : String branch nameReleaseBranchInvalidExceptionpublic ReleaseBranch createReleaseBranch(String branch, String releaseFilePath, String releaseFileContent, String message, String username) throws AdvancedSCMException
AdvancedSCMManagercreateReleaseBranch in interface AdvancedSCMManagerbranch - : String branch namereleaseFileContent - : String release file contentAdvancedSCMExceptionpublic List<String> getBranchNames(boolean all) throws AdvancedSCMException
AdvancedSCMManagergetBranchNames in interface AdvancedSCMManagerall - : get all or only open branchesAdvancedSCMExceptionpublic void ensureReleaseBranch(String branch, String releaseFilePath, String releaseFileContent, String message, String username) throws AdvancedSCMException, ReleaseBranchInvalidException
AdvancedSCMManagerensureReleaseBranch in interface AdvancedSCMManagerbranch - : String branch namereleaseFileContent - : String release file contentAdvancedSCMExceptionReleaseBranchInvalidExceptionpublic void createFile(String filename, String content) throws IOException, InterruptedException
filename: - String relative path to the file from the repository rootcontent: - String file content (UTF-8 encoding is hard-coded)IOExceptionInterruptedExceptionCopyright © 2004-2015. All Rights Reserved.