本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNUpdateClient类的典型用法代码示例。如果您正苦于以下问题:Java SVNUpdateClient类的具体用法?Java SVNUpdateClient怎么用?Java SVNUpdateClient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SVNUpdateClient类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNUpdateClient类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
@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);
}
}
示例3: runCheckout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
/**
* This is mostly inlined {@code SVNUpdateClient.doCheckout()} - to allow specifying necessary working copy format. Otherwise, if only
* {@link SvnWcGeneration} is used - either svn 1.6 or svn 1.8 working copy will be created.
* <p/>
* See also http://issues.tmatesoft.com/issue/SVNKIT-495 for more details.
*/
private static void runCheckout(@NotNull SVNUpdateClient client,
@NotNull WorkingCopyFormat format,
@NotNull SvnTarget source,
@NotNull File destination,
@Nullable SVNRevision revision,
@Nullable Depth depth,
boolean force) throws SVNException {
SvnCheckout checkoutOperation = createCheckoutOperation(client, format);
checkoutOperation.setUpdateLocksOnDemand(client.isUpdateLocksOnDemand());
checkoutOperation.setSource(SvnTarget.fromURL(source.getURL(), source.getPegRevision()));
checkoutOperation.setSingleTarget(SvnTarget.fromFile(destination));
checkoutOperation.setRevision(revision);
checkoutOperation.setDepth(toDepth(depth));
checkoutOperation.setAllowUnversionedObstructions(force);
checkoutOperation.setIgnoreExternals(client.isIgnoreExternals());
checkoutOperation.setExternalsHandler(SvnCodec.externalsHandler(client.getExternalsHandler()));
checkoutOperation.run();
}
示例4: export
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
@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);
}
}
示例5: performSVNupdate
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
/**
* @param svnPathString
* String which contains the local SVN folder path.
* @return Error code. If true --> SVN Operation failed.
*/
public final boolean performSVNupdate(final String svnPathString) {
SfdcCommander commander = SfdcCommander.getInstance();
boolean error = false;
File svnPath = new File(svnPathString);
// checkout
try {
ISVNAuthenticationManager authManager = getAuthManager(config);
SVNUpdateClient updateClient = new SVNUpdateClient(authManager,
SVNWCUtil.createDefaultOptions(true));
updateClient.doUpdate(svnPath, SVNRevision.HEAD, SVNDepth.INFINITY,
true, true);
commander.info("SVN Update successfully processed.");
} catch (SVNException e) {
commander.info(e.getMessage());
error = true;
}
return error;
}
示例6: checkout
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的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;
}
示例7: doUpdate
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
protected long doUpdate(
final File root,
final SVNUpdateClient client) throws
SVNException {
final SvnConfiguration svnConfig = SvnConfiguration.getInstance(myVcs.getProject());
MergeRootInfo info = svnConfig.getMergeRootInfo(root, myVcs);
if (info.getUrlString1().equals(info.getUrlString2()) &&
info.getRevision1().equals(info.getRevision2())) {
return 0;
}
SVNDiffClient diffClient = myVcs.createDiffClient();
diffClient.setEventHandler(myHandler);
diffClient.doMerge(info.getUrl1(), info.getRevision1(),
info.getUrl2(), info.getRevision2(), root,
svnConfig.UPDATE_DEPTH, svnConfig.MERGE_DIFF_USE_ANCESTRY, false, svnConfig.MERGE_DRY_RUN, false);
svnConfig.LAST_MERGED_REVISION = getLastMergedRevision(info.getRevision2(), info.getUrl2());
return info.getResultRevision();
}
示例8: handleWorkingCopyRoot
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
public void handleWorkingCopyRoot(File root, ProgressIndicator progress) {
if (progress != null) {
showProgressMessage(progress, root);
}
try {
SVNUpdateClient client = myVcs.createUpdateClient();
client.setEventHandler(myHandler);
long rev = doUpdate(root, client);
if (rev < 0 && !isMerge()) {
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.UNKNOWN, SvnBundle.message("exception.text.root.was.not.properly.updated", root)));
}
}
catch (SVNException e) {
LOG.info(e);
myExceptions.add(new VcsException(e));
}
}
示例9: 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;
}
}
示例10: doUpdate
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
/**
* 更新文件
*
* @param path
* @return
*/
public Long doUpdate(File... files) {
SVNUpdateClient updateClient = clientManager.getUpdateClient();
updateClient.setIgnoreExternals(false);
long version = 0;
long tempVersion = 0;
for (File file : files) {
try {
tempVersion = updateClient.doUpdate(file, SVNRevision.HEAD,
SVNDepth.INFINITY, false, false);
logger.info("update succcess");
version = (version > tempVersion) ? version : tempVersion;
} catch (SVNException e) {
logger.error("update error");
return null;
}
}
return version;
}
示例11: traverse
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
/**
* Méthode traverse.<br>
* Rôle :
*
* @param updateClient
* @param repository
* @param checkoutRootPath
* @param destRootPath
* @param repoPath
* @param evictTags : si on tombe une première fois sur trunk, branches ou tags, alors on n'élague plus les nouvelles occurrences rencontrées
* @throws SVNException
*/
public static void traverse(final SVNUpdateClient updateClient, final SVNRepository repository, final String checkoutRootPath, final String destRootPath, final String repoPath,
final boolean evictTags) throws SVNException {
System.out.println(repoPath);
if (!evictTags) {
checkout(updateClient, checkoutRootPath, destRootPath, repoPath, SVNDepth.INFINITY);
} else {
checkout(updateClient, checkoutRootPath, destRootPath, repoPath, SVNDepth.FILES);
final Collection<SVNDirEntry> entries = repository.getDir(repoPath, -1, null, (Collection) null);
for (final SVNDirEntry entry : entries) {
if (entry.getKind() != SVNNodeKind.DIR) {
continue;
}
boolean copieEvict = evictTags;
if (motsClefsSVN.contains(entry.getName())) {
copieEvict = false;
}
//si on doit encore passer le niveau tags/branches/trunk et que le rép courant n'est pas tags, alors on poursuit
if (!entry.getName().equalsIgnoreCase(TAGS)) {
traverse(
updateClient,
repository,
checkoutRootPath,
destRootPath,
repoPath.equals("") ? entry.getName() : repoPath + "/" + entry.getName(),
copieEvict);
}
}
}
}
示例12: checkoutTest
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的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());
}
示例13: getClient
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
@NotNull
private SVNUpdateClient getClient() {
SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();
client.setEventHandler(toEventHandler(myDispatcher));
client.setIgnoreExternals(myIgnoreExternals);
client.setUpdateLocksOnDemand(myLocksOnDemand);
return client;
}
示例14: createCheckoutOperation
import org.tmatesoft.svn.core.wc.SVNUpdateClient; //导入依赖的package包/类
@NotNull
private static SvnCheckout createCheckoutOperation(@NotNull SVNUpdateClient client, @NotNull WorkingCopyFormat format) {
if (WorkingCopyFormat.ONE_DOT_SIX.equals(format)) {
client.getOperationsFactory().setPrimaryWcGeneration(SvnWcGeneration.V16);
}
SvnCheckout checkoutOperation = client.getOperationsFactory().createCheckout();
if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(format)) {
checkoutOperation.setTargetWorkingCopyFormat(ISVNWCDb.WC_FORMAT_17);
}
return checkoutOperation;
}
示例15: 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);
}