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


Java DiffEntry.ChangeType方法代码示例

本文整理汇总了Java中org.eclipse.jgit.diff.DiffEntry.ChangeType方法的典型用法代码示例。如果您正苦于以下问题:Java DiffEntry.ChangeType方法的具体用法?Java DiffEntry.ChangeType怎么用?Java DiffEntry.ChangeType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jgit.diff.DiffEntry的用法示例。


在下文中一共展示了DiffEntry.ChangeType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: kind

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
@Override
public WatchEvent.Kind kind() {
    DiffEntry.ChangeType changeType = DiffEntry.ChangeType.valueOf(this.changeType);
    switch (changeType) {
        case ADD:
        case COPY:
            return StandardWatchEventKind.ENTRY_CREATE;
        case DELETE:
            return StandardWatchEventKind.ENTRY_DELETE;
        case MODIFY:
            return StandardWatchEventKind.ENTRY_MODIFY;
        case RENAME:
            return StandardWatchEventKind.ENTRY_RENAME;
        default:
            throw new RuntimeException("Unsupported change type: " + changeType);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:JGitWatchEvent.java

示例2: toChangeType

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
protected GitChangeType toChangeType(DiffEntry.ChangeType changeType) {
    switch (changeType) {
        case ADD:
            return GitChangeType.ADD;
        case COPY:
            return GitChangeType.COPY;
        case DELETE:
            return GitChangeType.DELETE;
        case MODIFY:
            return GitChangeType.MODIFY;
        case RENAME:
            return GitChangeType.RENAME;
        default:
            throw new IllegalArgumentException("Unknown diff change type: " + changeType);
    }
}
 
开发者ID:nemerosa,项目名称:ontrack,代码行数:17,代码来源:GitRepositoryClientImpl.java

示例3: getOverallChange

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public DiffEntry.ChangeType getOverallChange() {
    if (staged == null) {
        return unstaged.getChangeType();
    } else if (unstaged == null) {
        return staged.getChangeType();
    } else {
        if (unstaged.getChangeType() == DiffEntry.ChangeType.DELETE) {
            return DiffEntry.ChangeType.DELETE;
        }
        if (staged.getChangeType() == DiffEntry.ChangeType.ADD) {
            return DiffEntry.ChangeType.ADD;
        }
        if (getNewestPath().equals(getOldestPath())) {
            return DiffEntry.ChangeType.MODIFY;
        }
        // With if the file was copies at least *once*, then it is copied.
        if (staged.getChangeType() == DiffEntry.ChangeType.COPY ||
            unstaged.getChangeType() == DiffEntry.ChangeType.COPY) {
            return DiffEntry.ChangeType.COPY;
        }
        return DiffEntry.ChangeType.RENAME;
    }
}
 
开发者ID:morimekta,项目名称:gittool,代码行数:24,代码来源:FileStatus.java

示例4: getChange

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
private BlobChange getChange(TreeWalk treeWalk, RevCommit oldCommit, RevCommit newCommit) {
	DiffEntry.ChangeType changeType = DiffEntry.ChangeType.MODIFY;
	BlobIdent oldBlobIdent;
	if (!treeWalk.getObjectId(0).equals(ObjectId.zeroId())) {
		oldBlobIdent = new BlobIdent(oldCommit.name(), treeWalk.getPathString(), treeWalk.getRawMode(0));
	} else {
		oldBlobIdent = new BlobIdent(oldCommit.name(), null, FileMode.TREE.getBits());
		changeType = DiffEntry.ChangeType.ADD;
	}
	
	BlobIdent newBlobIdent;
	if (!treeWalk.getObjectId(1).equals(ObjectId.zeroId())) {
		newBlobIdent = new BlobIdent(newCommit.name(), treeWalk.getPathString(), treeWalk.getRawMode(1));
	} else {
		newBlobIdent = new BlobIdent(newCommit.name(), null, FileMode.TREE.getBits());
		changeType = DiffEntry.ChangeType.DELETE;
	}
	
	return new BlobChange(changeType, oldBlobIdent, newBlobIdent, WhitespaceOption.DEFAULT) {

		@Override
		public Blob getBlob(BlobIdent blobIdent) {
			return context.getProject().getBlob(blobIdent);
		}

	};
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:28,代码来源:CommitOptionPanel.java

示例5: CommitTreeInfo

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public CommitTreeInfo(String path, String name, long size, int mode, String id, String commitId, DiffEntry.ChangeType changeType) {
    this.path = path;
    this.name = name;
    this.size = size;
    this.mode = mode;
    this.id = id;
    this.commitId = commitId;
    this.changeType = changeType;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:10,代码来源:CommitTreeInfo.java

示例6: DiffInfo

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public DiffInfo(DiffEntry.ChangeType changeType, String newPath, int newMode, String oldPath, int oldMode, String diff) {
    this.changeType = changeType;
    this.newPath = newPath;
    this.newMode = newMode;
    this.oldPath = oldPath;
    this.oldMode = oldMode;
    this.diff = diff;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:9,代码来源:DiffInfo.java

示例7: doResources

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
private void doResources(FSRevisionRoot root, StringBuffer buffer) throws SVNException {
    Map sentPaths = new HashMap();
    for (String path : updates.keySet()) {
        DiffEntry.ChangeType type = updates.get(path);

        boolean sendSelf = false;
        boolean sendParent = false;
        if (type == DiffEntry.ChangeType.DELETE) {
            sendSelf = false;
            sendParent = true;
        } else if (type == DiffEntry.ChangeType.ADD || type == DiffEntry.ChangeType.MODIFY) {
            sendSelf = true;
            sendParent = true;
        } else {
            sendSelf = true;
            sendParent = false;
        }

        if (sendSelf) {
            if (!sentPaths.containsKey(path)) {
                SVNNodeKind pathKind = root.checkNodeKind(path);
                sendResponse(root, path, pathKind == SVNNodeKind.DIR, buffer);
                sentPaths.put(path, path);
            }
        }

        if (sendParent) {
            String parentPath = SVNPathUtil.removeTail(path);
            if (!sentPaths.containsKey(parentPath)) {
                sendResponse(root, parentPath, true, buffer);
                sentPaths.put(parentPath, parentPath);
            }
        }
    }
}
 
开发者ID:naver,项目名称:svngit,代码行数:36,代码来源:SVNGitMergeHandler.java

示例8: convert

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
/**
 * Construct a generic file object from the attributes of a git DiffEntry.
 *
 * @param  diff    DiffEntry data object
 * @return CMnFile data object
 */
private CMnFile convert(DiffEntry diff) {
    String filename = diff.getNewPath();
    CMnFile.Operation op = null;
    DiffEntry.ChangeType changeType = diff.getChangeType();
    if (changeType == DiffEntry.ChangeType.ADD){
        op = CMnFile.Operation.ADD;
    } else if (changeType == DiffEntry.ChangeType.DELETE){
        op = CMnFile.Operation.DELETE;
    } else if (changeType == DiffEntry.ChangeType.RENAME){
        op = CMnFile.Operation.RENAME;
    } else {
        op = CMnFile.Operation.EDIT;
    }
    CMnFile file = new CMnFile(filename, op);

    // Convert the file diff to a string
    try {
        OutputStream out = new ByteArrayOutputStream();
        DiffFormatter df = new DiffFormatter(out);
        df.setRepository(repository.getRepository());
        df.setDiffComparator(diffComparator);
        df.setDetectRenames(true);
        df.format(diff);
        df.flush();
        file.setDiff(out.toString());
    } catch (IOException ioex) {
    }

    return file;
}
 
开发者ID:ModelN,项目名称:build-management,代码行数:37,代码来源:CMnGitServer.java

示例9: jgitChangeTypes

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
@Parameterized.Parameters
public static Iterable<DiffEntry.ChangeType> jgitChangeTypes() {
    return Arrays.asList(DiffEntry.ChangeType.values());
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:5,代码来源:ChangeTypeConsistencyTest.java

示例10: ChangeTypeConsistencyTest

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public ChangeTypeConsistencyTest(DiffEntry.ChangeType diffEntryChangeType) {
    this.diffEntryChangeType = diffEntryChangeType;
}
 
开发者ID:arquillian,项目名称:smart-testing,代码行数:4,代码来源:ChangeTypeConsistencyTest.java

示例11: getChangeType

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public DiffEntry.ChangeType getChangeType() {
    return changeType;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:4,代码来源:CommitTreeInfo.java

示例12: setChangeType

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public void setChangeType(DiffEntry.ChangeType changeType) {
    this.changeType = changeType;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:4,代码来源:CommitTreeInfo.java

示例13: getUpdates

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public Map<String, DiffEntry.ChangeType> getUpdates() {
	return updates;
}
 
开发者ID:naver,项目名称:svngit,代码行数:4,代码来源:TreeBuilder.java

示例14: Result

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public Result(Map<String, DiffEntry.ChangeType> updates, ObjectId treeId) {
	this.updates = updates;
	this.treeId = treeId;
}
 
开发者ID:naver,项目名称:svngit,代码行数:5,代码来源:TreeBuilder.java

示例15: jgitToCoderadar

import org.eclipse.jgit.diff.DiffEntry; //导入方法依赖的package包/类
public ChangeType jgitToCoderadar(DiffEntry.ChangeType changeType) {
  return ChangeType.valueOf(changeType.name());
}
 
开发者ID:reflectoring,项目名称:coderadar,代码行数:4,代码来源:ChangeTypeMapper.java


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