本文整理汇总了Java中org.eclipse.jgit.diff.DiffEntry.ChangeType.COPY属性的典型用法代码示例。如果您正苦于以下问题:Java ChangeType.COPY属性的具体用法?Java ChangeType.COPY怎么用?Java ChangeType.COPY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jgit.diff.DiffEntry.ChangeType
的用法示例。
在下文中一共展示了ChangeType.COPY属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitRev
private void visitRev(Rev rev, int number) {
Timer visitAllTimer = visitAllStat.timer();
visitor.onStartRev(rev, null, number);
for (ParentRelation parentRelation: rev.getParentRelations()) {
for (Diff diff : parentRelation.getDiffs()) {
if (diff.getType() == ChangeType.ADD) {
visitor.onAddedFile(diff);
} else if (diff.getType() == ChangeType.COPY) {
visitor.onCopiedFile(diff);
} else if (diff.getType() == ChangeType.DELETE) {
visitor.onDeletedFile(diff);
} else if (diff.getType() == ChangeType.MODIFY) {
visitor.onModifiedFile(diff);
} else if (diff.getType() == ChangeType.RENAME) {
visitor.onRenamedFile(diff);
}
}
}
visitor.onCompleteRev(rev, null);
visitAllTimer.track();
}
示例2: visitRev
private void visitRev(Rev rev, Rev traverseParentRev, int number) {
Preconditions.checkArgument(!traversedRevs.contains(rev));
Timer visitAllTimer = visitFullETStat.timer();
visitor.onStartRev(rev,traverseParentRev, number);
for (ParentRelation parentRelation: rev.getParentRelations()) {
for (Diff diff : parentRelation.getDiffs()) {
if (diff.getType() == ChangeType.ADD) {
visitor.onAddedFile(diff);
} else if (diff.getType() == ChangeType.COPY) {
visitor.onCopiedFile(diff);
} else if (diff.getType() == ChangeType.DELETE) {
visitor.onDeletedFile(diff);
} else if (diff.getType() == ChangeType.MODIFY) {
visitor.onModifiedFile(diff);
} else if (diff.getType() == ChangeType.RENAME) {
visitor.onRenamedFile(diff);
}
}
}
visitor.onCompleteRev(rev, traverseParentRev);
visitAllTimer.track();
}
示例3: onInitialize
@Override
protected void onInitialize() {
super.onInitialize();
if (change.getType() == ChangeType.ADD || change.getType() == ChangeType.COPY) {
showBlob(change.getNewBlob());
} else if (change.getType() == ChangeType.DELETE) {
showBlob(change.getOldBlob());
} else {
if (change.getOldText() != null && change.getNewText() != null) {
if (change.getOldText().getLines().size() + change.getNewText().getLines().size() > DiffUtils.MAX_DIFF_SIZE) {
add(newFragment("Unable to diff as the file is too large.", true));
} else if (change.getAdditions() + change.getDeletions() > WebConstants.MAX_SINGLE_FILE_DIFF_LINES) {
add(newFragment("Diff is too large to be displayed.", true));
} else if (change.getAdditions() + change.getDeletions() == 0
&& (markSupport == null || markSupport.getComments().isEmpty())) {
add(newFragment("Content is identical", false));
} else {
add(new TextDiffPanel(CONTENT_ID, projectModel, requestModel, change, diffMode, blameModel, markSupport));
}
} else if (change.getOldBlob().isPartial() || change.getNewBlob().isPartial()) {
add(newFragment("File is too large to be loaded.", true));
} else if (change.getOldBlob().getMediaType().equals(change.getNewBlob().getMediaType())) {
Panel diffPanel = null;
for (DiffRenderer renderer: GitPlex.getExtensions(DiffRenderer.class)) {
diffPanel = renderer.render(CONTENT_ID, change.getNewBlob().getMediaType(), change);
if (diffPanel != null)
break;
}
if (diffPanel != null)
add(diffPanel);
else
add(newFragment("Binary file.", false));
} else {
add(newFragment("Binary file.", false));
}
}
}
示例4: isRename
private static boolean isRename(DiffEntry ent) {
return ent.getChangeType() == ChangeType.RENAME
|| ent.getChangeType() == ChangeType.COPY;
}
示例5: hasNewPath
private boolean hasNewPath(DiffEntry d) {
return d.getChangeType()==ChangeType.COPY || d.getChangeType()==ChangeType.RENAME;
}