package com.googlecode.svntask.command;

import java.io.File;

import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNUpdateClient;

import com.googlecode.svntask.Command;


/**
 * Used for executing svn update. Defaults to recursive and force == true.
 *
 * @author jonstevens
 */
public class Update extends Command
{
	private String path;
	private boolean recursive = true;
	private boolean force = true;

	@Override
	public void execute() throws Exception
	{
		File filePath = new File(this.path);

		this.getTask().log("update " + filePath.getCanonicalPath());

		// Get the Update Client
		SVNUpdateClient client = this.getTask().getSvnClient().getUpdateClient();

		// Execute svn info
		client.doUpdate(filePath, SVNRevision.HEAD, SVNDepth.INFINITY, this.recursive, this.force);
	}

	@Override
	protected void validateAttributes() throws Exception
	{
		if (this.path == null)
			throw new Exception("path cannot be null");
	}

	public void setPath(String path)
	{
		this.path = path;
	}

	public void setRecursive(boolean recursive)
	{
		this.recursive = recursive;
	}

	public void setForce(boolean force)
	{
		this.force = force;
	}
}

@@ -402,16 +402,111 @@
 g path;%0A
+%09private SVNRevision revision = SVNRevision.HEAD;%0A%09private SVNDepth depth = SVNDepth.INFINITY;%0A
 %09private
@@ -880,43 +880,33 @@
 th, 
-SVNR
+this.r
 evision
-.HEAD, SVNDepth.INFINITY
+, this.depth
 , th
@@ -936,16 +936,24 @@
 e);%0A%09%7D%0A%0A
+%09/** */%0A
 %09@Overri
@@ -1084,24 +1084,32 @@
 null%22);%0A%09%7D%0A%0A
+%09/** */%0A
 %09public void
@@ -1153,24 +1153,229 @@
 = path;%0A%09%7D%0A%0A
+%09/** */%0A%09public void setRevision(long revision)%0A%09%7B%0A%09%09this.revision = SVNRevision.create(revision);%0A%09%7D%0A%0A%09/** */%0A%09public void setDepth(String depth)%0A%09%7B%0A%09%09this.depth = SVNDepth.fromString(depth);%0A%09%7D%0A%0A%09/** */%0A
 %09public void
@@ -1444,16 +1444,24 @@
 ve;%0A%09%7D%0A%0A
+%09/** */%0A
 %09public 

add setters for configurable properties.