org.jenkinsci.plugins.darcs
Class DarcsCmd

java.lang.Object
  extended by org.jenkinsci.plugins.darcs.DarcsCmd

public class DarcsCmd
extends Object

Abstracts the Darcs command.

Author:
Sven Strittmatter

Nested Class Summary
static class DarcsCmd.DarcsCmdException
          Darcs command exception.
 
Field Summary
private static String CMD_CHANGES
          `darcs changes` command.
private static String CMD_GET
          `darcs get` command.
private static String CMD_PULL
          `darcs pull` command.
private  String darcsExe
          Name of the Darcs executable binary.
private  Map<String,String> envs
          Environment variables.
private  Launcher launcher
          Used to start a process.
private static String OPT_ALL
           
private static String OPT_COUNT
           
private static String OPT_LAST
           
private static String OPT_REPO
           
private static String OPT_REPODIR
           
private static String OPT_SUMMARY
           
private static String OPT_VERBOSE
           
private static String OPT_XML_OUTPUT
           
private  FilePath workingDir
           
 
Constructor Summary
DarcsCmd(Launcher launcher, Map<String,String> envs, String darcsExe, FilePath workingDir)
          Creates a Darcs command object.
 
Method Summary
 ByteArrayOutputStream allChanges(String repo)
           
 ByteArrayOutputStream allSummarizedChanges(String repo)
           
 int countChanges(String repo)
           
 Launcher.ProcStarter createProc(ArgumentListBuilder args)
          Creates process starter.
 void get(String repo, String from)
          Do a fresh checkout of a repository.
private  ByteArrayOutputStream getChanges(String repo, boolean summarize)
           
private  ByteArrayOutputStream getChanges(String repo, boolean summarize, int n)
           
 ByteArrayOutputStream lastSummarizedChanges(String repo, int n)
           
 void pull(String repo, String from)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD_CHANGES

private static final String CMD_CHANGES
`darcs changes` command.

See Also:
Constant Field Values

CMD_PULL

private static final String CMD_PULL
`darcs pull` command.

See Also:
Constant Field Values

CMD_GET

private static final String CMD_GET
`darcs get` command.

See Also:
Constant Field Values

OPT_REPO

private static final String OPT_REPO
See Also:
Constant Field Values

OPT_XML_OUTPUT

private static final String OPT_XML_OUTPUT
See Also:
Constant Field Values

OPT_SUMMARY

private static final String OPT_SUMMARY
See Also:
Constant Field Values

OPT_LAST

private static final String OPT_LAST
See Also:
Constant Field Values

OPT_REPODIR

private static final String OPT_REPODIR
See Also:
Constant Field Values

OPT_COUNT

private static final String OPT_COUNT
See Also:
Constant Field Values

OPT_ALL

private static final String OPT_ALL
See Also:
Constant Field Values

OPT_VERBOSE

private static final String OPT_VERBOSE
See Also:
Constant Field Values

launcher

private final Launcher launcher
Used to start a process.


darcsExe

private final String darcsExe
Name of the Darcs executable binary.


envs

private final Map<String,String> envs
Environment variables.


workingDir

private final FilePath workingDir
Constructor Detail

DarcsCmd

public DarcsCmd(Launcher launcher,
                Map<String,String> envs,
                String darcsExe,
                FilePath workingDir)
Creates a Darcs command object.

Parameters:
launcher - starts a process
envs - environment variables
darcsExe - executable name
Method Detail

createProc

public Launcher.ProcStarter createProc(ArgumentListBuilder args)
Creates process starter.

Parameters:
args - builds argument list for command
Returns:
a process starter object

lastSummarizedChanges

public ByteArrayOutputStream lastSummarizedChanges(String repo,
                                                   int n)
                                            throws DarcsCmd.DarcsCmdException
Throws:
DarcsCmd.DarcsCmdException

allSummarizedChanges

public ByteArrayOutputStream allSummarizedChanges(String repo)
                                           throws DarcsCmd.DarcsCmdException
Throws:
DarcsCmd.DarcsCmdException

allChanges

public ByteArrayOutputStream allChanges(String repo)
                                 throws DarcsCmd.DarcsCmdException
Throws:
DarcsCmd.DarcsCmdException

getChanges

private ByteArrayOutputStream getChanges(String repo,
                                         boolean summarize)
                                  throws DarcsCmd.DarcsCmdException
Throws:
DarcsCmd.DarcsCmdException

getChanges

private ByteArrayOutputStream getChanges(String repo,
                                         boolean summarize,
                                         int n)
                                  throws DarcsCmd.DarcsCmdException
Throws:
DarcsCmd.DarcsCmdException

countChanges

public int countChanges(String repo)
                 throws DarcsCmd.DarcsCmdException
Throws:
DarcsCmd.DarcsCmdException

pull

public void pull(String repo,
                 String from)
          throws DarcsCmd.DarcsCmdException
Throws:
DarcsCmd.DarcsCmdException

get

public void get(String repo,
                String from)
         throws DarcsCmd.DarcsCmdException
Do a fresh checkout of a repository.

Parameters:
repo - where to checkout
from - from where to get the repository
Throws:
DarcsCmd.DarcsCmdException - if can't do checkout


Copyright © 2004-2013 weltraumschaf.de. All Rights Reserved.