From 27fe4c28a23b301578c15a701c24d9918ed15b4b Mon Sep 17 00:00:00 2001 From: Marco Miller Date: Tue, 12 Apr 2016 13:55:53 -0400 Subject: [PATCH] Add ui messages about updating or installing each plugin using pgm init Add plugin name to existing message prompting the user to overwrite it or not; confusing otherwise. Simplify that message by removing the redundant 'version' word. Such messages are only for non-batch mode so far by design. Change-Id: I31a1460ec74db841fe3a3e5f7986c8d8cea890aa --- .../java/com/google/gerrit/pgm/init/InitPlugins.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitPlugins.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitPlugins.java index ea74f905b2..5efb6c2745 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitPlugins.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitPlugins.java @@ -130,9 +130,8 @@ public class InitPlugins implements InitStep { if (upgrade) { final String installedPluginVersion = getVersion(p); - if (!ui.yesno(upgrade, - "version %s is already installed, overwrite it", - installedPluginVersion)) { + if (!ui.yesno(upgrade, "%s %s is already installed, overwrite it", + plugin.name, installedPluginVersion)) { Files.deleteIfExists(tmpPlugin); continue; } @@ -145,6 +144,12 @@ public class InitPlugins implements InitStep { } try { Files.move(tmpPlugin, p); + if (upgrade) { + // or update that is not an upgrade + ui.message("Updated %s to %s\n", plugin.name, plugin.version); + } else { + ui.message("Installed %s %s\n", plugin.name, plugin.version); + } } catch (IOException e) { throw new IOException("Failed to install plugin " + pluginName + ": " + tmpPlugin.toAbsolutePath() + " -> "