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
IOException
InterruptedException
public List<Branch> getBranches(boolean all)
AdvancedSCMManager
getBranches
in interface AdvancedSCMManager
all
- : get all or only open branchespublic String getBranch() throws AdvancedSCMException
AdvancedSCMManager
AdvancedSCMException
public void update(String revision) throws AdvancedSCMException
AdvancedSCMManager
revision
- : String with revision, hash of branchname to update to.AdvancedSCMException
public void updateClean(String revision) throws AdvancedSCMException
AdvancedSCMManager
revision
- : String with revision, hash of branchname to update to.AdvancedSCMException
public void stripLocal() throws AdvancedSCMException
AdvancedSCMManager
AdvancedSCMException
public void clean() throws AdvancedSCMException
AdvancedSCMManager
AdvancedSCMException
public void closeBranch(String branch, String message, String username) throws AdvancedSCMException
AdvancedSCMManager
message
- : String with message to give this commit.username
- : String commit user name (with email)AdvancedSCMException
public void mergeWorkspaceWith(String revision, String updateTo) throws AdvancedSCMException
AdvancedSCMManager
revision
- : String with revision, hash or branchname to merge with.updateTo
- : String with revision, hash or branchname to update working copy to before actual merge.AdvancedSCMException
public void mergeHeads(String message, String username) throws AdvancedSCMException
AdvancedSCMManager
message
- : String commit messageusername
- : String commit user name (with email)AdvancedSCMException
public void commit(String message, String username) throws AdvancedSCMException
AdvancedSCMManager
message
- : String commit messageusername
- : String commit user name (with email)AdvancedSCMException
public void push(String... branchNames) throws AdvancedSCMException
AdvancedSCMManager
AdvancedSCMException
public void pull() throws AdvancedSCMException
AdvancedSCMManager
AdvancedSCMException
public void pull(String remote) throws AdvancedSCMException
AdvancedSCMManager
AdvancedSCMException
public void pull(String remote, String branch) throws AdvancedSCMException
AdvancedSCMManager
AdvancedSCMException
public ReleaseBranch getReleaseBranch(String branch) throws ReleaseBranchInvalidException
AdvancedSCMManager
branch
- : String branch nameReleaseBranchInvalidException
public ReleaseBranch createReleaseBranch(String branch, String releaseFilePath, String releaseFileContent, String message, String username) throws AdvancedSCMException
AdvancedSCMManager
createReleaseBranch
in interface AdvancedSCMManager
branch
- : String branch namereleaseFileContent
- : String release file contentAdvancedSCMException
public List<String> getBranchNames(boolean all) throws AdvancedSCMException
AdvancedSCMManager
getBranchNames
in interface AdvancedSCMManager
all
- : get all or only open branchesAdvancedSCMException
public void ensureReleaseBranch(String branch, String releaseFilePath, String releaseFileContent, String message, String username) throws AdvancedSCMException, ReleaseBranchInvalidException
AdvancedSCMManager
ensureReleaseBranch
in interface AdvancedSCMManager
branch
- : String branch namereleaseFileContent
- : String release file contentAdvancedSCMException
ReleaseBranchInvalidException
public 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)IOException
InterruptedException
Copyright © 2004-2015. All Rights Reserved.