本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout方法的典型用法代码示例。如果您正苦于以下问题:Java SVNUpdateClient.doCheckout方法的具体用法?Java SVNUpdateClient.doCheckout怎么用?Java SVNUpdateClient.doCheckout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.wc.SVNUpdateClient
的用法示例。
在下文中一共展示了SVNUpdateClient.doCheckout方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
private static void checkout(final SVNUpdateClient updateClient, final String checkoutRootPath, final String destRootPath, final String repoPath, final SVNDepth depth) {
// updateClient.doExport(
// SVNURL.parseURIDecoded(checkoutRootPath + "/" + repoPath),
// new File(destRootPath + (!repoPath.isEmpty() ? "/" : "") + repoPath),
// SVNRevision.UNDEFINED,
// SVNRevision.HEAD,
// null,
// true,
// depth);
try {
updateClient.doCheckout(
SVNURL.parseURIDecoded(checkoutRootPath + "/" + repoPath),
new File(destRootPath + (!repoPath.isEmpty() ? "/" : "") + repoPath),
SVNRevision.UNDEFINED,
SVNRevision.HEAD,
depth,
true);
} catch (final SVNException e) {
System.err.println("Exception sur le fichier " + checkoutRootPath + "/" + repoPath);
System.err.println(e.getMessage());
}
}
示例2: doCheckout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
/**
* 签出到指定目录
*
* @return
*/
public Long doCheckout(String path) {
File workDir = new File(path);
if (!workDir.exists()) {
logger.info("workpath not exists, create workpath");
workDir.mkdirs();
}
try {
SVNUpdateClient updateClient = clientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
long version = updateClient
.doCheckout(repositoryURL, workDir, SVNRevision.HEAD,
SVNRevision.HEAD, SVNDepth.INFINITY, true);
logger.info("checkout success");
return version;
} catch (SVNException svne) {
logger.error("checkout error :" + svne.getMessage());
return null;
}
}
示例3: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
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);
}
示例4: performCheckOut
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
/**
* @param svnPathString
* String which contains the local SVN folder path.
* @param aConfig
* CommanderConfig for SVN Connect.
* @return Error code. If true --> SVN Operation failed.
*/
public final boolean performCheckOut(final String svnPathString,
final CommanderConfig aConfig) {
SfdcCommander commander = SfdcCommander.getInstance();
boolean error = false;
File svn_logFolder = new File(svnPathString + "/.svn");
File svnPath = new File(svnPathString);
// checkout
if (!svn_logFolder.exists()) {
try {
SVNURL url = SVNURL.parseURIDecoded(
aConfig.getSvnConfig().getSvnRepository());
ISVNAuthenticationManager authManager = getAuthManager(aConfig);
SVNUpdateClient updateClient = new SVNUpdateClient(authManager,
SVNWCUtil.createDefaultOptions(true));
updateClient.setIgnoreExternals(false);
updateClient.doCheckout(url, svnPath, SVNRevision.HEAD,
SVNRevision.HEAD, SVNDepth.INFINITY, true);
commander.info("SVN Checkout successfully processed.");
} catch (SVNException e) {
commander.info(e.getErrorMessage().getFullMessage());
error = true;
}
}
return error;
}
示例5: update
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
public long update(final File file, SVNRevision revision, SVNDepth i) throws SVNException {
if (i == null) {
i = SVNDepth.INFINITY;
}
// JDIO.removeDirectoryOrFile(file);
file.mkdirs();
final SVNUpdateClient updateClient = getUpdateClient();
updateClient.setIgnoreExternals(false);
if (revision == null) {
revision = SVNRevision.HEAD;
}
try {
// getWCClient().doAdd(path, force, mkdir, climbUnversionedParents,
// depth, includeIgnored, makeParents);
// long ret = updateClient.doCheckout(svnurl, file, revision,
// revision, i, true);
Log.L.info("SVN Update at " + file + " to Revision " + revision + " depths:" + i + " " + svnurl);
long ret = updateClient.doUpdate(file, revision, i, false, true);
if (ret < 0) {
// no working copy?
ret = updateClient.doCheckout(svnurl, file, revision, revision, i, true);
}
return ret;
} catch (final Exception e) {
Log.L.info(e.getMessage());
Log.L.info("SVN Checkout at " + file + " " + svnurl);
return updateClient.doCheckout(svnurl, file, revision, revision, i, true);
} finally {
Log.L.info("SVN Update finished");
}
}
示例6: downloadCode
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
/**
* Faz o checkout do repositório. O atributo src_path deve ser setado.
*/
@Override
public void downloadCode(File path) {
System.out.println("Downloading code...");
this.src_path = path;
FileUtils.deleteRecursive(path);
SVNUpdateClient update_client = svn_client.getUpdateClient();
update_client.setIgnoreExternals(false);
try {
update_client.doCheckout(SVN_url, path, null,
revision_range.getEndRevision(), SVNDepth.INFINITY, false);
} catch (SVNException e) {
e.printStackTrace();
}
}
示例7: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
private static long checkout(SVNURL url,
SVNRevision revision, File destPath, boolean isRecursive, boolean allowUnversionedObstructions)
throws SVNException {
SVNUpdateClient updateClient = ourClientManager.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),
allowUnversionedObstructions);
}
示例8: svnCheckout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
/**
*
* @param destinationPath - Destination Path for checkout
* @return -1 if not authenticated, 1 warning - destination path already exists and is a directory, 2 error destination path exists and is file, 0 success
*/
public int svnCheckout(String destinationPath) {
int flag = 0;
if (username == null || password == null) {
return -1;
}
File fileDestinationPath = new File(destinationPath);
if (fileDestinationPath.exists()) {
if (fileDestinationPath.isFile()) {
return 2;
} else if (fileDestinationPath.isDirectory()) {
flag = 1;
}
}
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
SVNClientManager clientManager = SVNClientManager.newInstance(options, this.username, this.password);
SVNUpdateClient updateClient = clientManager.getUpdateClient();
try {
updateClient.doCheckout(projectUrl, fileDestinationPath, SVNRevision.UNDEFINED, SVNRevision.HEAD, SVNDepth.INFINITY, true);
} catch (SVNException e) {
System.out.println("Exception ");
e.printStackTrace();
}
System.out.println("Checkout finished successfully !");
return flag;
}
示例9: checkOutFromSvn
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
public static String checkOutFromSvn(String tableId,String project, String modelName) {
//获取SVN驱动选项
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
// 实例化客户端管理类
SVNClientManager ourClientManager = SVNClientManager.newInstance((DefaultSVNOptions) options, USERNAME, PASSWORD);
SVNURL repositoryURL = null;
// 需要循环seg_*
try {
// 通过客户端管理类获得updateClient类的实例。
SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
int is_h=0;
for (int i = 0; i < 100; i++) {
String seg="seg_"+i;
String url=URL_ROOT + modelM.get("DataFlow") + "/table/";
url+=seg;
String filepath = PATH + seg;
del(filepath);
repositoryURL = SVNURL.parseURIEncoded(url);
boolean b = isURLExist(repositoryURL, "zhangkai05", "zhangkai05");
if(b) {
is_h++;
updateClient.setIgnoreExternals(true);
// 执行check out 操作,返回工作副本的版本号。
long workingVersion = updateClient.doCheckout(repositoryURL, new File(filepath),SVNRevision.HEAD, SVNRevision.HEAD, SVNDepth.INFINITY,false);
//System.out.println(workingVersion + "版本获得成功!");
}
}
//is_h
String file_path = getFile(tableId, PATH, is_h);
return file_path;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
示例10: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
/**
* Performs a checkout for a project with the given URL on the given destination directory
* @param url the project URL
* @param destination the destination directory
* @throws SVNException
*/
public void checkout(String url, File destination) throws SVNException {
SVNUpdateClient client = svn.getUpdateClient();
client.doCheckout(SVNURL.parseURIDecoded(url),
destination,
SVNRevision.HEAD,
SVNRevision.HEAD,
SVNDepth.INFINITY,
false);
}
示例11: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
public void checkout(Path worktree, String path) throws SVNException {
SVNUpdateClient updateClient = manager.getUpdateClient();
updateClient.doCheckout(localRepository.appendPath(path, false),
worktree.toFile(), null, null, SVNDepth.INFINITY, false);
}
示例12: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
public long checkout(final File file, SVNRevision revision, final SVNDepth i) throws SVNException {
file.mkdirs();
final SVNUpdateClient updateClient = getUpdateClient();
updateClient.setIgnoreExternals(false);
if (revision == null) {
revision = SVNRevision.HEAD;
}
return updateClient.doCheckout(svnurl, file, revision, revision, i, true);
}
示例13: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入方法依赖的package包/类
/**
* Checks out a working copy from a repository. Like 'svn checkout URL[@REV] PATH (-r..)'
* command; It's done by invoking
* <p/>
* SVNUpdateClient.doCheckout(SVNURL url, File dstPath, SVNRevision pegRevision,
* SVNRevision revision, boolean recursive)
* <p/>
* which takes the following parameters:
* <p/>
* url - a repository location from where a working copy is to be checked out;
* <p/>
* dstPath - a local path where the working copy will be fetched into;
* <p/>
* 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;
* <p/>
* revision - a revision at which a working copy being checked out is to be;
* <p/>
* 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( SVNUpdateClient updateClient, SVNURL url, SVNRevision revision, File destPath,
boolean isRecursive )
throws SVNException
{
/*
* 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, isRecursive );
}