本文整理汇总了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;
}
示例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;
}
}
}
}
示例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);
}