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


Java SVNLogEntryPath.getCopyPath方法代码示例

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


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

示例1: buildChangePath

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入方法依赖的package包/类
/**
 * Builds a ChangePath from an SVNLogEntryPath object.
 * @param svnLogEntryPath The SVNLogEntryPath object from which to
 * build the ChangePath.
 * @return The populated ChangePath object.
 */
private ChangePath buildChangePath(final SVNLogEntryPath svnLogEntryPath) {
   ChangePath result = null;
   
   final String svnChangePath = svnLogEntryPath.getPath();
   final String svnChangeType =
         Character.toString(svnLogEntryPath.getType());
   
   if (svnLogEntryPath.getCopyPath() != null) {
      final String svnCopyPath = svnLogEntryPath.getCopyPath();
      final long svnCopyRevision =
            svnLogEntryPath.getCopyRevision();
      result =
            new ChangePath(
                  svnChangePath,
                  svnChangeType,
                  svnCopyPath,
                  svnCopyRevision
            );
   } else {
      result = new ChangePath(svnChangePath, svnChangeType);
   }

   return result;
}
 
开发者ID:fuerve,项目名称:VillageElder,代码行数:31,代码来源:SubversionRepository.java

示例2: handleLogEntry

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入方法依赖的package包/类
@Override
public void handleLogEntry(SVNLogEntry logEntry) throws SVNException {
  if (myRoot) {
    return;
  }
  myBefore = myPath;
  myDirectlyMentioned = null;
  final Map<String,SVNLogEntryPath> paths = logEntry.getChangedPaths();
  final SVNLogEntryPath entryPath = paths.get(myPath);
  if (entryPath != null) {
    myDirectlyMentioned = entryPath;
    // exact match
    if (entryPath.getCopyPath() != null) {
      myPath = entryPath.getCopyPath();
      return;
    }
  }
  for (SVNLogEntryPath path : paths.values()) {
    // "the origin path *from where* the item, ..."
    final String copyPath = path.getCopyPath();
    if (copyPath != null) {
      final String thisEntryPath = path.getPath();
      if (parentPathChanged(copyPath, thisEntryPath)) {
        return;
      }
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:SvnPathThroughHistoryCorrection.java

示例3: classifiedChange

import org.tmatesoft.svn.core.SVNLogEntryPath; //导入方法依赖的package包/类
static ChangeInfo classifiedChange(final SVNRepository repository, final SVNLogEntry entry, String rootPath, final String path) throws SVNException {
  StoreKind kind = StoreKind.OTHER;
  // Be sure the root path ends with a slash because the 'path' will always have the slash.
  if (!rootPath.endsWith("/")) {
    rootPath = rootPath + "/";
  }
  String name = path.length() > rootPath.length() ? path.substring(rootPath.length()) : path;
  String page = null;
  Matcher matcher = PAGE_PATH.matcher(name);
  if (matcher.matches() && !name.endsWith("-attachments")) {
    kind = StoreKind.PAGE;
    page = name;
  }
  else {
    matcher = ATTACHMENT_PATH.matcher(name);
    if (matcher.matches()) {
      kind = StoreKind.ATTACHMENT;
      page = matcher.group(1);
      name = matcher.group(2);
    }
  }
  String user = entry.getAuthor();
  Date date = entry.getDate();
  SVNLogEntryPath logForPath = (SVNLogEntryPath) entry.getChangedPaths().get(path);

  PageLinkTarget renamedTo = null;
  for (Object entryPath : entry.getChangedPaths().values()) {
    SVNLogEntryPath logEntryPath = (SVNLogEntryPath) entryPath;
    if (ChangeType.forCode(logEntryPath.getType()).equals(ChangeType.ADDED) && path.equals(logEntryPath.getCopyPath())) {
      if (logEntryPath.getPath().startsWith(rootPath)) {
        renamedTo = new SimplePageLinkTarget(null, new PageReferenceImpl(logEntryPath.getPath()).getName(), null, null);
      }
      else {
        renamedTo = new SVNPathLinkTarget(repository.getRepositoryRoot(false).toString(), logEntryPath.getPath());
      }
    }
  }
  String copiedFrom = logForPath.getCopyPath();
  long copiedFromRevision = -1;
  if (SVNPathUtil.isAncestor(rootPath, copiedFrom)) {
    copiedFrom = SVNPathUtil.tail(copiedFrom);
    copiedFromRevision = logForPath.getCopyRevision();
  }
  else {
    copiedFrom = null;
  }
  return new ChangeInfo(page, name, user, date, entry.getRevision(), entry.getMessage(), kind, ChangeType.forCode(logForPath.getType()), copiedFrom, copiedFromRevision, renamedTo);
}
 
开发者ID:CoreFiling,项目名称:reviki,代码行数:49,代码来源:RepositoryBasicSVNOperations.java


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