com.aragost.javahg.commands
Class GraftCommand

java.lang.Object
  extended by com.aragost.javahg.internals.AbstractCommand
      extended by com.aragost.javahg.commands.flags.GraftCommandFlags
          extended by com.aragost.javahg.commands.GraftCommand

public class GraftCommand
extends GraftCommandFlags

Command class for executing hg graft. Set flags from GraftCommandFlags and call the execute(com.aragost.javahg.Changeset) method.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.aragost.javahg.internals.AbstractCommand
AbstractCommand.State
 
Constructor Summary
GraftCommand(Repository repository)
           
 
Method Summary
protected  void clear()
           
protected  void doneHook()
          This method is called when the processing of a command is finished.
 GraftContext execute(Changeset changeset)
          Run hg graft with the specified revisions.
 boolean executeContinue()
          Execute the graft command with the continue flag.
 boolean isSuccessful()
          Check if the command ended with a zero return code.
 
Methods inherited from class com.aragost.javahg.commands.flags.GraftCommandFlags
currentdate, currentuser, date, getCommandName, on, tool, user
 
Methods inherited from class com.aragost.javahg.internals.AbstractCommand
cancel, cmdAppend, cmdAppend, cmdAppend, cmdAppend, cmdAppend, 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

GraftCommand

public GraftCommand(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 GraftContext execute(Changeset changeset)
Run hg graft with the specified revisions.

If the grafting is succesful null is return. Otherwise a MergeContext is return where the conflicts can be inspected and resolved.

Parameters:
changeset - the changeset to graft

executeContinue

public boolean executeContinue()
Execute the graft command with the continue flag.

Returns:
true if a new changeset was created, false if for some reason graft did not succeed

doneHook

protected void doneHook()
Description copied from class: AbstractCommand
This method is called when the processing of a command is finished. More precise it is called just after the 'r' channel is read

It can be overridden in subclasses.

Overrides:
doneHook in class AbstractCommand

clear

protected void clear()
Overrides:
clear in class AbstractCommand


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