本文整理汇总了Java中org.eclipse.jgit.diff.DiffEntry.ChangeType.DELETE属性的典型用法代码示例。如果您正苦于以下问题:Java ChangeType.DELETE属性的具体用法?Java ChangeType.DELETE怎么用?Java ChangeType.DELETE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jgit.diff.DiffEntry.ChangeType
的用法示例。
在下文中一共展示了ChangeType.DELETE属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getNewBlobIdent
public static BlobIdent getNewBlobIdent(DiffEntry diffEntry, String newRev) {
BlobIdent blobIdent;
if (diffEntry.getChangeType() != ChangeType.DELETE) {
blobIdent = new BlobIdent(newRev, diffEntry.getNewPath(), diffEntry.getNewMode().getBits());
} else {
blobIdent = new BlobIdent(newRev, null, null);
}
return blobIdent;
}
示例5: convertTypeToGit
private static ChangeType convertTypeToGit( String type ) {
if ( type.equals( "added" ) | type.equals( "unversioned" ) ) {
return ChangeType.ADD;
} else if ( type.equals( "deleted" ) | type.equals( "missing" ) ) {
return ChangeType.DELETE;
} else if ( type.equals( "modified" ) | type.equals( "normal" ) | type.equals( "replaced" ) ) {
return ChangeType.MODIFY;
} else {
return ChangeType.MODIFY;
}
}
示例6: addToIndex
public void addToIndex() throws Exception {
List<UIFile> contents = getSelectedChangedFiles();
for ( UIFile content : contents ) {
if ( content.getChangeType() == ChangeType.DELETE ) {
vcs.rm( content.getName() );
} else {
vcs.add( content.getName() );
}
}
changedBinding.fireSourceChanged();
}
示例7: getEditsDueToRebase
private static Set<ContextAwareEdit> getEditsDueToRebase(
Multimap<String, ContextAwareEdit> editsDueToRebasePerFilePath, DiffEntry diffEntry) {
if (editsDueToRebasePerFilePath.isEmpty()) {
return ImmutableSet.of();
}
String filePath = diffEntry.getNewPath();
if (diffEntry.getChangeType() == ChangeType.DELETE) {
filePath = diffEntry.getOldPath();
}
return ImmutableSet.copyOf(editsDueToRebasePerFilePath.get(filePath));
}
示例8: getFileName
public String getFileName() {
if (changeType == ChangeType.RENAME) {
return oldPath + " => " + newPath;
} else if (changeType == ChangeType.DELETE) {
return oldPath;
}
return newPath;
}
示例9: getPaths
private Path[] getPaths(final Diff diff) {
if (diff.getType() == ChangeType.DELETE) {
return new Path[] {new Path(diff.getOldPath())};
} else if (diff.getType() == ChangeType.RENAME) {
return new Path[] {new Path(diff.getOldPath()), new Path(diff.getNewPath())};
} else {
return new Path[] {new Path(diff.getNewPath())};
}
}