本文整理汇总了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);
}
示例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);
}
示例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;
}