com.aragost.javahg.commands
Class UpdateCommand

java.lang.Object
  extended by com.aragost.javahg.internals.AbstractCommand
      extended by com.aragost.javahg.commands.flags.UpdateCommandFlags
          extended by com.aragost.javahg.commands.UpdateCommand

public class UpdateCommand
extends UpdateCommandFlags

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


Nested Class Summary
 
Nested classes/interfaces inherited from class com.aragost.javahg.internals.AbstractCommand
AbstractCommand.State
 
Constructor Summary
UpdateCommand(Repository repository)
           
 
Method Summary
 boolean crossedBranch()
           
 UpdateResult execute()
          Run hg update on a clean working copy.
 UpdateResult execute(ManifestMergeOracle oracle)
          Run hg update with a merge oracle.
 boolean isSuccessful()
          Check if the command ended with a zero return code.
 UpdateCommand rev(Changeset cset)
          Set the --rev flag.
 
Methods inherited from class com.aragost.javahg.commands.flags.UpdateCommandFlags
check, clean, date, getCommandName, on, rev
 
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

UpdateCommand

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

execute

public UpdateResult execute()
                     throws IOException
Run hg update on a clean working copy. This runs with no merge oracle and so the caller must ensure that there are no merge conflicts.

Returns:
the update result.
Throws:
IOException

execute

public UpdateResult execute(ManifestMergeOracle oracle)
                     throws IOException
Run hg update with a merge oracle.

Parameters:
oracle - the merge oracle to use in case of merge conflicts.
Returns:
the update result.
Throws:
IOException

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.

crossedBranch

public boolean crossedBranch()
Returns:
True if the command was not successful because it would have crossed branches. Applicable to updates where revision is not specified.

rev

public UpdateCommand rev(Changeset cset)
Set the --rev flag.

Parameters:
cset - the changeset to update to
Returns:
this command.


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