hudson.plugins.mercurial
Class HgExe

java.lang.Object
  extended by hudson.plugins.mercurial.HgExe

public class HgExe
extends java.lang.Object

Encapsulates the invocation of "hg".

This reduces the amount of code in the main logic. TODO: perhaps a subtype 'Repository' with a repository location field would be good.

Author:
Kohsuke Kawaguchi

Field Summary
 hudson.Launcher launcher
           
 hudson.model.TaskListener listener
           
 hudson.model.Node node
           
 
Constructor Summary
HgExe(MercurialSCM scm, hudson.Launcher launcher, hudson.model.AbstractBuild build, hudson.model.TaskListener listener, hudson.EnvVars env)
           
HgExe(MercurialSCM scm, hudson.Launcher launcher, hudson.model.Node node, hudson.model.TaskListener listener, hudson.EnvVars env)
           
 
Method Summary
 hudson.Launcher.ProcStarter bundle(java.util.Collection<java.lang.String> bases, java.lang.String file)
           
 hudson.Launcher.ProcStarter bundleAll(java.lang.String file)
           
 hudson.Launcher.ProcStarter cleanAll()
           
 hudson.Launcher.ProcStarter clone(java.lang.String... args)
           
 java.util.Set<java.lang.String> heads(hudson.FilePath repo, boolean useTimeout)
          Obtains the heads of the repository.
 hudson.Launcher.ProcStarter init(hudson.FilePath path)
           
 java.lang.String popen(hudson.FilePath repository, hudson.model.TaskListener listener, boolean useTimeout, hudson.util.ArgumentListBuilder args)
          Runs the command and captures the output.
 hudson.Launcher.ProcStarter pull()
           
 hudson.Launcher.ProcStarter run(hudson.util.ArgumentListBuilder args)
           
 hudson.Launcher.ProcStarter run(java.lang.String... args)
          Runs arbitrary command.
 java.lang.String tip(hudson.FilePath repository)
          Gets the revision ID of the tip of the workspace.
 java.util.List<java.lang.String> toArgList()
           
 hudson.Launcher.ProcStarter unbundle(java.lang.String bundleFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

launcher

public final hudson.Launcher launcher

node

public final hudson.model.Node node

listener

public final hudson.model.TaskListener listener
Constructor Detail

HgExe

public HgExe(MercurialSCM scm,
             hudson.Launcher launcher,
             hudson.model.AbstractBuild build,
             hudson.model.TaskListener listener,
             hudson.EnvVars env)
      throws java.io.IOException,
             java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException

HgExe

public HgExe(MercurialSCM scm,
             hudson.Launcher launcher,
             hudson.model.Node node,
             hudson.model.TaskListener listener,
             hudson.EnvVars env)
      throws java.io.IOException,
             java.lang.InterruptedException
Throws:
java.io.IOException
java.lang.InterruptedException
Method Detail

pull

public hudson.Launcher.ProcStarter pull()

clone

public hudson.Launcher.ProcStarter clone(java.lang.String... args)

bundleAll

public hudson.Launcher.ProcStarter bundleAll(java.lang.String file)

bundle

public hudson.Launcher.ProcStarter bundle(java.util.Collection<java.lang.String> bases,
                                          java.lang.String file)

init

public hudson.Launcher.ProcStarter init(hudson.FilePath path)

unbundle

public hudson.Launcher.ProcStarter unbundle(java.lang.String bundleFile)

cleanAll

public hudson.Launcher.ProcStarter cleanAll()

run

public hudson.Launcher.ProcStarter run(java.lang.String... args)
Runs arbitrary command.


run

public hudson.Launcher.ProcStarter run(hudson.util.ArgumentListBuilder args)

heads

public java.util.Set<java.lang.String> heads(hudson.FilePath repo,
                                             boolean useTimeout)
                                      throws java.io.IOException,
                                             java.lang.InterruptedException
Obtains the heads of the repository.

Throws:
java.io.IOException
java.lang.InterruptedException

tip

@CheckForNull
public java.lang.String tip(hudson.FilePath repository)
                     throws java.io.IOException,
                            java.lang.InterruptedException
Gets the revision ID of the tip of the workspace.

Throws:
java.io.IOException
java.lang.InterruptedException

toArgList

public java.util.List<java.lang.String> toArgList()

popen

public java.lang.String popen(hudson.FilePath repository,
                              hudson.model.TaskListener listener,
                              boolean useTimeout,
                              hudson.util.ArgumentListBuilder args)
                       throws java.io.IOException,
                              java.lang.InterruptedException
Runs the command and captures the output.

Throws:
java.io.IOException
java.lang.InterruptedException


Copyright © 2011. All Rights Reserved.