本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNClientManager.getUpdateClient方法的典型用法代码示例。如果您正苦于以下问题:Java SVNClientManager.getUpdateClient方法的具体用法?Java SVNClientManager.getUpdateClient怎么用?Java SVNClientManager.getUpdateClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.tmatesoft.svn.core.wc.SVNClientManager
的用法示例。
在下文中一共展示了SVNClientManager.getUpdateClient方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkout
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
private File checkout(String scmUrl) throws Exception {
ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
ISVNAuthenticationManager isvnAuthenticationManager = SVNWCUtil.createDefaultAuthenticationManager(null, null, (char[]) null, false);
SVNClientManager svnClientManager = SVNClientManager.newInstance(options, isvnAuthenticationManager);
File out = temp.newFolder();
SVNUpdateClient updateClient = svnClientManager.getUpdateClient();
SvnCheckout co = updateClient.getOperationsFactory().createCheckout();
co.setUpdateLocksOnDemand(updateClient.isUpdateLocksOnDemand());
co.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(scmUrl), SVNRevision.HEAD));
co.setSingleTarget(SvnTarget.fromFile(out));
co.setRevision(SVNRevision.HEAD);
co.setDepth(SVNDepth.INFINITY);
co.setAllowUnversionedObstructions(false);
co.setIgnoreExternals(updateClient.isIgnoreExternals());
co.setExternalsHandler(SvnCodec.externalsHandler(updateClient.getExternalsHandler()));
co.setTargetWorkingCopyFormat(wcVersion);
co.run();
return out;
}
示例2: checkoutTest
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
public void checkoutTest() throws SVNException {
String checkoutPath = "svn://localhost";
String username = "integration";
String password = "integration";
String checkoutRootPath = new File("/home/jeremie/Developpement/checkoutsvn").getAbsolutePath();
DAVRepositoryFactory.setup();
final SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(checkoutPath));
repository.setAuthenticationManager(SVNWCUtil.createDefaultAuthenticationManager(username, password));
final SVNClientManager clientManager = SVNClientManager.newInstance(null, repository.getAuthenticationManager());
final SVNUpdateClient updateClient = clientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
final SVNNodeKind nodeKind = repository.checkPath("", -1);
if (nodeKind == SVNNodeKind.NONE) {
System.err.println("There is no entry at '" + checkoutPath + "'.");
System.exit(1);
} else if (nodeKind == SVNNodeKind.FILE) {
System.err.println("The entry at '" + checkoutPath + "' is a file while a directory was expected.");
System.exit(1);
}
System.out.println("*** CHECKOUT SVN Trunk/Branches ***");
System.out.println("Checkout source: " + checkoutPath);
System.out.println("Checkout destination: " + checkoutRootPath);
System.out.println("...");
try {
traverse(updateClient, repository, checkoutPath, checkoutRootPath, "", true);
} catch (final Exception e) {
System.err.println("ERROR : " + e.getMessage());
e.printStackTrace(System.err);
System.exit(-1);
}
System.out.println("");
System.out.println("Repository latest revision: " + repository.getLatestRevision());
}
示例3: checkout
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的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: update
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
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);
}
示例5: switchToURL
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
public static long switchToURL(SVNClientManager clientManager, File wcPath, SVNURL url, SVNRevision updateToRevision,
boolean isRecursive) throws SVNException {
SVNUpdateClient updateClient = clientManager.getUpdateClient();
/*
* sets externals not to be ignored during the switch
*/
updateClient.setIgnoreExternals(false);
/*
* returns the number of the revision wcPath was updated to
*/
return updateClient.doSwitch(wcPath, url, SVNRevision.UNDEFINED, updateToRevision, SVNDepth.getInfinityOrFilesDepth(isRecursive),
false, false);
}
示例6: export
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
public static long export( 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.doExport( url, destPath, revision, revision, "native", true, isRecursive );
}
示例7: svnCheckout
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的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;
}
示例8: checkOutFromSvn
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的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;
}
示例9: switchToURL
import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
/**
* Updates a working copy to a different URL. Like 'svn switch URL' command.
* It's done by invoking
* <p/>
* SVNUpdateClient.doSwitch(File file, SVNURL url, SVNRevision revision, boolean recursive)
* <p/>
* which takes the following parameters:
* <p/>
* file - a working copy entry that is to be switched to a new url;
* <p/>
* url - a target URL a working copy is to be updated against;
* <p/>
* revision - a revision to which a working copy is to be updated;
* <p/>
* recursive - if true and an entry (file) is a directory then doSwitch(..) recursively
* switches the entire directory, otherwise - only child entries of the directory;
*/
public static long switchToURL( SVNClientManager clientManager, File wcPath, SVNURL url,
SVNRevision updateToRevision, boolean isRecursive )
throws SVNException
{
SVNUpdateClient updateClient = clientManager.getUpdateClient();
/*
* sets externals not to be ignored during the switch
*/
updateClient.setIgnoreExternals( false );
/*
* returns the number of the revision wcPath was updated to
*/
return updateClient.doSwitch( wcPath, url, updateToRevision, isRecursive );
}