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


Java ChangeType.DELETE属性代码示例

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

示例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;
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:11,代码来源:SVN.java

示例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();
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:11,代码来源:GitController.java

示例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));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:12,代码来源:PatchListLoader.java

示例8: getFileName

public String getFileName() {
  if (changeType == ChangeType.RENAME) {
    return oldPath + " => " + newPath;
  } else if (changeType == ChangeType.DELETE) {
    return oldPath;
  }
  return newPath;
}
 
开发者ID:kamegu,项目名称:git-webapp,代码行数:8,代码来源:DiffInfo.java

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


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