mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[updater] conflicts logging (IDEA-215497)
GitOrigin-RevId: 96a8887ca99b0688641fa6ef75c64a89256bc09e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
369c6c66e2
commit
1f26db8ab6
@@ -326,14 +326,7 @@ public class Runner {
|
||||
File destDir = dest.toFile();
|
||||
preparationResult = PatchFileCreator.prepareAndValidate(patchFile, destDir, ui);
|
||||
|
||||
List<ValidationResult> problems = preparationResult.validationResults;
|
||||
Map<String, ValidationResult.Option> resolutions = problems.isEmpty() ? Collections.emptyMap() : ui.askUser(problems);
|
||||
if (! resolutions.isEmpty()) {
|
||||
logger().warn("Some conflicts were found: ");
|
||||
for (Map.Entry<String, ValidationResult.Option> entry : resolutions.entrySet()) {
|
||||
logger().warn(" " + entry.getKey());
|
||||
}
|
||||
}
|
||||
Map<String, ValidationResult.Option> resolutions = askForResolutions(preparationResult.validationResults, ui);
|
||||
|
||||
if (doBackup) {
|
||||
backupDir = Utils.getTempFile("backup");
|
||||
@@ -459,14 +452,7 @@ public class Runner {
|
||||
for (File patchFile : patchFiles) {
|
||||
PatchFileCreator.PreparationResult preparationResult = PatchFileCreator.prepareAndValidate(patchFile, destDir, ui);
|
||||
|
||||
List<ValidationResult> problems = preparationResult.validationResults;
|
||||
Map<String, ValidationResult.Option> resolutions = problems.isEmpty() ? Collections.emptyMap() : ui.askUser(problems);
|
||||
if (! resolutions.isEmpty()) {
|
||||
logger().warn("Some conflicts were found: ");
|
||||
for (Map.Entry<String, ValidationResult.Option> entry : resolutions.entrySet()) {
|
||||
logger().warn(" " + entry.getKey());
|
||||
}
|
||||
}
|
||||
Map<String, ValidationResult.Option> resolutions = askForResolutions(preparationResult.validationResults, ui);
|
||||
|
||||
PatchFileCreator.ApplicationResult applicationResult = PatchFileCreator.apply(preparationResult, resolutions, null, ui);
|
||||
needRestore |= !applicationResult.appliedActions.isEmpty();
|
||||
@@ -543,6 +529,22 @@ public class Runner {
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, ValidationResult.Option> askForResolutions(
|
||||
List<ValidationResult> problems, UpdaterUI ui
|
||||
) throws OperationCancelledException {
|
||||
if (problems.isEmpty()) return Collections.emptyMap();
|
||||
logger().warn("conflicts:");
|
||||
for (ValidationResult problem : problems) {
|
||||
logger().warn(" " + problem.action.name() + " @ " + problem.path + ": " + problem.message);
|
||||
}
|
||||
Map<String, ValidationResult.Option> resolutions = ui.askUser(problems);
|
||||
logger().warn("resolutions:");
|
||||
for (Map.Entry<String, ValidationResult.Option> entry : resolutions.entrySet()) {
|
||||
logger().warn(" " + entry.getKey() + ": " + entry.getValue());
|
||||
}
|
||||
return resolutions;
|
||||
}
|
||||
|
||||
private static void refreshApplicationIcon(String destPath) {
|
||||
if (Utils.IS_MAC) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user