Search in sources :

Example 1 with SVNUpdateClient

use of org.tmatesoft.svn.core.wc.SVNUpdateClient in project intellij-community by JetBrains.

the class SvnKitCheckoutClient method checkout.

@Override
public void checkout(@NotNull SvnTarget source, @NotNull File destination, @Nullable SVNRevision revision, @Nullable Depth depth, boolean ignoreExternals, boolean force, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
    assertUrl(source);
    validateFormat(format, getSupportedFormats());
    SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();
    client.setIgnoreExternals(ignoreExternals);
    client.setEventHandler(toEventHandler(handler));
    try {
        runCheckout(client, format, source, destination, revision, depth, force);
    } catch (SVNException e) {
        throw new SvnBindException(e);
    }
}
Also used : SVNUpdateClient(org.tmatesoft.svn.core.wc.SVNUpdateClient) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNException(org.tmatesoft.svn.core.SVNException)

Example 2 with SVNUpdateClient

use of org.tmatesoft.svn.core.wc.SVNUpdateClient in project intellij-community by JetBrains.

the class SvnKitUpdateClient method getClient.

@NotNull
private SVNUpdateClient getClient() {
    SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();
    client.setEventHandler(toEventHandler(myDispatcher));
    client.setIgnoreExternals(myIgnoreExternals);
    client.setUpdateLocksOnDemand(myLocksOnDemand);
    return client;
}
Also used : SVNUpdateClient(org.tmatesoft.svn.core.wc.SVNUpdateClient) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with SVNUpdateClient

use of org.tmatesoft.svn.core.wc.SVNUpdateClient in project intellij-community by JetBrains.

the class SvnKitExportClient method export.

@Override
public void export(@NotNull SvnTarget from, @NotNull File to, @Nullable SVNRevision revision, @Nullable Depth depth, @Nullable String nativeLineEnd, boolean force, boolean ignoreExternals, @Nullable ProgressTracker handler) throws VcsException {
    SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();
    client.setEventHandler(toEventHandler(handler));
    client.setIgnoreExternals(ignoreExternals);
    try {
        if (from.isFile()) {
            client.doExport(from.getFile(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
        } else {
            client.doExport(from.getURL(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
        }
    } catch (SVNException e) {
        throw new SvnBindException(e);
    }
}
Also used : SVNUpdateClient(org.tmatesoft.svn.core.wc.SVNUpdateClient) SvnBindException(org.jetbrains.idea.svn.commandLine.SvnBindException) SVNException(org.tmatesoft.svn.core.SVNException)

Example 4 with SVNUpdateClient

use of org.tmatesoft.svn.core.wc.SVNUpdateClient in project oxTrust by GluuFederation.

the class SvnHelper method update.

/*
	 * Updates a working copy (brings changes from the repository into the
	 * working copy). Like 'svn update PATH' command; It's done by invoking
	 * 
	 * SVNUpdateClient.doUpdate(File file, SVNRevision revision, boolean
	 * recursive)
	 * 
	 * which takes the following parameters:
	 * 
	 * file - a working copy entry that is to be updated;
	 * 
	 * revision - a revision to which a working copy is to be updated;
	 * 
	 * recursive - if true and an entry is a directory then doUpdate(..)
	 * recursively updates the entire directory, otherwise - only child entries
	 * of the directory;
	 */
public static long update(SVNClientManager clientManager, File wcPath, SVNRevision updateToRevision, boolean isRecursive) throws SVNException {
    SVNUpdateClient updateClient = clientManager.getUpdateClient();
    /*
		 * sets externals not to be ignored during the update
		 */
    updateClient.setIgnoreExternals(false);
    /*
		 * returns the number of the revision wcPath was updated to
		 */
    return updateClient.doUpdate(wcPath, updateToRevision, SVNDepth.fromRecurse(isRecursive), false, false);
}
Also used : SVNUpdateClient(org.tmatesoft.svn.core.wc.SVNUpdateClient)

Example 5 with SVNUpdateClient

use of org.tmatesoft.svn.core.wc.SVNUpdateClient in project oxTrust by GluuFederation.

the class SvnHelper method checkout.

/*
	 * Checks out a working copy from a repository. Like 'svn checkout URL[@REV]
	 * PATH (-r..)' command; It's done by invoking
	 * 
	 * SVNUpdateClient.doCheckout(SVNURL url, File dstPath, SVNRevision
	 * pegRevision, SVNRevision revision, boolean recursive)
	 * 
	 * which takes the following parameters:
	 * 
	 * url - a repository location from where a working copy is to be checked
	 * out;
	 * 
	 * dstPath - a local path where the working copy will be fetched into;
	 * 
	 * pegRevision - an SVNRevision representing a revision to concretize url
	 * (what exactly URL a user means and is sure of being the URL he needs); in
	 * other words that is the revision in which the URL is first looked up;
	 * 
	 * revision - a revision at which a working copy being checked out is to be;
	 * 
	 * recursive - if true and url corresponds to a directory then
	 * doCheckout(..) recursively fetches out the entire directory, otherwise -
	 * only child entries of the directory;
	 */
public static long checkout(SVNClientManager clientManager, SVNURL url, SVNRevision revision, File destPath, boolean isRecursive) throws SVNException {
    SVNUpdateClient updateClient = clientManager.getUpdateClient();
    /*
		 * sets externals not to be ignored during the checkout
		 */
    updateClient.setIgnoreExternals(false);
    /*
		 * returns the number of the revision at which the working copy is
		 */
    return updateClient.doCheckout(url, destPath, revision, revision, SVNDepth.fromRecurse(isRecursive), false);
}
Also used : SVNUpdateClient(org.tmatesoft.svn.core.wc.SVNUpdateClient)

Aggregations

SVNUpdateClient (org.tmatesoft.svn.core.wc.SVNUpdateClient)6 SvnBindException (org.jetbrains.idea.svn.commandLine.SvnBindException)2 SVNException (org.tmatesoft.svn.core.SVNException)2 NotNull (org.jetbrains.annotations.NotNull)1