com.aragost.javahg.commands
Class PushCommand

java.lang.Object
  extended by com.aragost.javahg.internals.AbstractCommand
      extended by com.aragost.javahg.commands.flags.PushCommandFlags
          extended by com.aragost.javahg.commands.PushCommand

public class PushCommand
extends PushCommandFlags

Command class for executing hg push. Set flags from PushCommandFlags and call the execute() method.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.aragost.javahg.internals.AbstractCommand
AbstractCommand.State
 
Constructor Summary
PushCommand(Repository repository)
           
 
Method Summary
 List<Changeset> execute()
          Run hg pull using the default path.
 List<Changeset> execute(String destination)
          Run hg push destination with an explicit destination path.
 boolean isSuccessful()
          Check if the command ended with a zero return code.
 
Methods inherited from class com.aragost.javahg.commands.flags.PushCommandFlags
bookmark, branch, force, getCommandName, insecure, newBranch, on, remotecmd, rev, ssh
 
Methods inherited from class com.aragost.javahg.internals.AbstractCommand
cancel, clear, cmdAppend, cmdAppend, cmdAppend, cmdAppend, cmdAppend, doneHook, getErrorString, getRepository, getReturnCode, launchIterator, launchStream, launchString, needsInputLine, reopenOutputChannelStream, sendLine, toString, withDebugAndChangesetStyle, withDebugFlag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PushCommand

public PushCommand(Repository repository)
Parameters:
repository - the repository associated with this command.
Method Detail

isSuccessful

public boolean isSuccessful()
Description copied from class: AbstractCommand
Check if the command ended with a zero return code. Subclasses can override this to accept other return codes as successful.

Overrides:
isSuccessful in class AbstractCommand
Returns:
true if the command ended successfully.

execute

public List<Changeset> execute()
                        throws IOException
Run hg pull using the default path.

Returns:
list of pushed changesets.
Throws:
IOException

execute

public List<Changeset> execute(String destination)
                        throws IOException
Run hg push destination with an explicit destination path.

Parameters:
destination - the destination path. Cannot be null.
Returns:
list of pushed changesets.
Throws:
IOException


Copyright © 2011-2013 aragost Trifork ag. All Rights Reserved.