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


Java ResolveMerger.MergeFailureReason方法代码示例

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


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

示例1: getFailures

import org.eclipse.jgit.merge.ResolveMerger; //导入方法依赖的package包/类
private List<File> getFailures (MergeResult result) {
    List<File> files = new LinkedList<File>();
    Map<String, ResolveMerger.MergeFailureReason> obstructions = result.getFailingPaths();
    if (obstructions != null) {
        for (Map.Entry<String, ResolveMerger.MergeFailureReason> failure : obstructions.entrySet()) {
            files.add(new File(workDir, failure.getKey()));
        }
    }
    return Collections.unmodifiableList(files);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:GitMergeResult.java

示例2: getFailures

import org.eclipse.jgit.merge.ResolveMerger; //导入方法依赖的package包/类
private List<File> getFailures (CherryPickResult result) {
    List<File> files = new ArrayList<>();
    File workDir = getRepository().getWorkTree();
    if (result.getStatus() == CherryPickResult.CherryPickStatus.FAILED) {
        Map<String, ResolveMerger.MergeFailureReason> obstructions = result.getFailingPaths();
        if (obstructions != null) {
            for (Map.Entry<String, ResolveMerger.MergeFailureReason> failure : obstructions.entrySet()) {
                files.add(new File(workDir, failure.getKey()));
            }
        }
    }
    return Collections.unmodifiableList(files);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CherryPickCommand.java

示例3: mergeApi

import org.eclipse.jgit.merge.ResolveMerger; //导入方法依赖的package包/类
/**
 * Merge the check-in into the destination branch using an API call.
 *
 * @param   src        Source branch
 * @param   dest       Destination branch
 * @param   id         Check-in ID of the change to be merged
 * @return  Result of the merge operation
 */
public MergeResult mergeApi(String src, String dest, String id) throws Exception {
    MergeResult result = null;

    Date startCherryPick = new Date();
    CherryPickCommand cpCmd = repository.cherryPick();
    logger.info("Attempting to locate commit object " + id);
    cpCmd.include(getCommit(id));
    logger.info("Performing cherry-pick of " + id);
    CherryPickResult cmdResult = cpCmd.call();
    CMnCmdLineTool.logElapsedTime(logger, startCherryPick, new Date(), "Cherry-pick: ");

    // Check the results of the merge operation
    CherryPickResult.CherryPickStatus cpStatus = cmdResult.getStatus();
    switch (cpStatus) {
        case CONFLICTING:
            result = MergeResult.CONFLICT;
            break;
        case OK:
            result = MergeResult.SUCCESS;
            break;
        case FAILED:
            result = MergeResult.FAILURE;
            Date startFailureResults = new Date();
            Map<String, ResolveMerger.MergeFailureReason> failures = cmdResult.getFailingPaths();
            Set<String> keys = failures.keySet();
            Iterator keyIter = keys.iterator();
            while (keyIter.hasNext()) {
                String key = (String) keyIter.next();
                ResolveMerger.MergeFailureReason reason = (ResolveMerger.MergeFailureReason) failures.get(key);
                logger.severe("Merge failure: " + key + ": " + reason);
            }
            CMnCmdLineTool.logElapsedTime(logger, startFailureResults, new Date(), "Fetch failing paths: ");
            break;
    }

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


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