当前位置: 首页>>代码示例>>Java>>正文


Java SVNClientManager.getWCClient方法代码示例

本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNClientManager.getWCClient方法的典型用法代码示例。如果您正苦于以下问题:Java SVNClientManager.getWCClient方法的具体用法?Java SVNClientManager.getWCClient怎么用?Java SVNClientManager.getWCClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.tmatesoft.svn.core.wc.SVNClientManager的用法示例。


在下文中一共展示了SVNClientManager.getWCClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSVNReposForRevision

import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
private SVNRepository getSVNReposForRevision(final SVNRepository repository, final long revision) throws SVNException {
  SVNClientManager manager = SVNClientManager.newInstance(SVNWCUtil.createDefaultOptions(true), repository.getAuthenticationManager());
  try {
    SVNWCClient client = manager.getWCClient();
    SVNInfo info1 = client.doInfo(repository.getLocation(), SVNRevision.HEAD, SVNRevision.create(revision));

    SVNRepository reposForRev = SVNRepositoryFactory.create(info1.getURL());
    reposForRev.setAuthenticationManager(repository.getAuthenticationManager());

    return reposForRev;
  }
  finally {
    manager.dispose();
  }
}
 
开发者ID:CoreFiling,项目名称:reviki,代码行数:16,代码来源:RepositoryBasicSVNOperations.java

示例2: doInWorkingDirectory

import org.tmatesoft.svn.core.wc.SVNClientManager; //导入方法依赖的package包/类
static void doInWorkingDirectory(
    final Logger logger,
    final File userDir,
    final String username,
    final String password,
    final SVNURL svnUrl,
    final FileBasedProctorStore.ProctorUpdater updater,
    final String comment) throws IOException, SVNException, Exception {
    final BasicAuthenticationManager authManager = new BasicAuthenticationManager(username, password);
    final SVNClientManager userClientManager = SVNClientManager.newInstance(null, authManager);
    final SVNWCClient wcClient = userClientManager.getWCClient();

    try {
        // Clean up the UserDir
        SvnProctorUtils.cleanUpWorkingDir(logger, userDir, svnUrl, userClientManager);

        /*
            if (previousVersion != 0) {
                final Collection<?> changesSinceGivenVersion = repo.log(new String[] { "" }, null, previousVersion, -1, false, false);
                if (! changesSinceGivenVersion.isEmpty()) {
                    //  TODO: the baseline version is out of date, so need to go back to the user
                }
            }
            updateClient.doCheckout(checkoutUrl, workingDir, null, SVNRevision.HEAD, SVNDepth.INFINITY, false);
        */

        final FileBasedProctorStore.RcsClient rcsClient = new SvnPersisterCoreImpl.SvnRcsClient(wcClient);
        final boolean thingsChanged = updater.doInWorkingDirectory(rcsClient, userDir);

        if (thingsChanged) {
            final SVNCommitClient commitClient = userClientManager.getCommitClient();
            final SVNCommitPacket commit = commitClient.doCollectCommitItems(new File[]{userDir}, false, false, SVNDepth.INFINITY, new String[0]);
            long elapsed = -System.currentTimeMillis();
            final SVNCommitInfo info = commitClient.doCommit(commit, /* keepLocks */ false, comment);
            elapsed += System.currentTimeMillis();
            if (logger.isDebugEnabled()) {
                final StringBuilder changes = new StringBuilder("Committed " + commit.getCommitItems().length + " changes: ");
                for (final SVNCommitItem item : commit.getCommitItems()) {
                    changes.append(item.getKind() + " - " + item.getPath() + ", ");
                }
                changes.append(String.format(" in %d ms new revision: r%d", elapsed, info.getNewRevision()));
                logger.debug(changes.toString());
            }
        }
    } finally {
        userClientManager.dispose();
    }
}
 
开发者ID:indeedeng,项目名称:proctor,代码行数:49,代码来源:SvnProctorUtils.java


注:本文中的org.tmatesoft.svn.core.wc.SVNClientManager.getWCClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。