com.aragost.javahg.commands
Class CloneCommand

java.lang.Object
  extended by com.aragost.javahg.internals.AbstractCommand
      extended by com.aragost.javahg.commands.flags.CloneCommandFlags
          extended by com.aragost.javahg.commands.CloneCommand

public class CloneCommand
extends CloneCommandFlags

Command class for executing hg clone. Set flags from CloneCommandFlags and call the execute(java.lang.String) method.

Use this command class to clone the current repository to somewhere else without opening the destination. An example of this is cloning to a remote SSH path.

To clone a remote repository to a local destination, use the Repository.clone(java.io.File, String) factory method.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.aragost.javahg.internals.AbstractCommand
AbstractCommand.State
 
Constructor Summary
CloneCommand(Repository repository)
           
 
Method Summary
 String execute(String destination)
          Clone the current repository to another destination.
 
Methods inherited from class com.aragost.javahg.commands.flags.CloneCommandFlags
branch, getCommandName, insecure, noupdate, on, pull, remotecmd, rev, ssh, uncompressed, updaterev
 
Methods inherited from class com.aragost.javahg.internals.AbstractCommand
cancel, clear, cmdAppend, cmdAppend, cmdAppend, cmdAppend, cmdAppend, doneHook, getErrorString, getRepository, getReturnCode, isSuccessful, 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

CloneCommand

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

execute

public String execute(String destination)
               throws IOException
Clone the current repository to another destination.

The equivalent command line call is hg clone . destination.

Parameters:
destination - a path to a local destination or a (SSH) URL to a remote destination.
Returns:
the output of the clone operation.
Throws:
IOException


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