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


Java ChangeType.COPY属性代码示例

本文整理汇总了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();
}
 
开发者ID:markus1978,项目名称:srcrepo,代码行数:23,代码来源:RepositoryModelFlatTraversal.java

示例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();
}
 
开发者ID:markus1978,项目名称:srcrepo,代码行数:24,代码来源:RepositoryModelTraversal.java

示例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));
		}
	}
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:38,代码来源:BlobDiffPanel.java

示例4: isRename

private static boolean isRename(DiffEntry ent) {
	return ent.getChangeType() == ChangeType.RENAME
			|| ent.getChangeType() == ChangeType.COPY;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:4,代码来源:TreeRevFilter.java

示例5: hasNewPath

private boolean hasNewPath(DiffEntry d) {
    return d.getChangeType()==ChangeType.COPY || d.getChangeType()==ChangeType.RENAME;
}
 
开发者ID:jenkinsci,项目名称:git-client-plugin,代码行数:3,代码来源:JGitAPIImpl.java


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