From fe9a2bf50a9632023fcb1d0c27ad1664e48b91b7 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 17 May 2007 19:49:07 +0000
Subject: [PATCH] The upgrader writes a log in the history directory that contains information about attempts to upgrade and contains references to the current and upgrade build. Formerly these were SVN revision numbers which is not very informative to humans. This commit writes the build's major, minor, point and revision numbers in the historical log.
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index 63dbd11..08e65ca 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -277,20 +277,20 @@
private Long historicalOperationId;
/**
- * SVN rev number of the current build.
+ * Information on the current build.
*/
- private Integer currentVersion = null;
+ private BuildInformation currentVersion = null;
+
+ /**
+ * Information on the staged build.
+ */
+ private BuildInformation stagedVersion = null;
/**
* New OpenDS bits.
*/
private Installation stagedInstallation = null;
- /**
- * SVN rev number of the build in the stage directory.
- */
- private Integer stagedVersion = null;
-
private RemoteBuildManager remoteBuildManager = null;
/** Set to true if the user decides to close the window while running. */
@@ -1033,8 +1033,8 @@
LOG.log(Level.INFO, "recording upgrade history");
setCurrentProgressStep(UpgradeProgressStep.RECORDING_HISTORY);
writeHistoricalRecord(historicalOperationId,
- getCurrentVersion(),
- getStagedVersion(),
+ getCurrentBuildInformation(),
+ getStagedBuildInformation(),
status,
note);
notifyListeners(formatter.getFormattedDone() +
@@ -1262,8 +1262,8 @@
}
private Long writeInitialHistoricalRecord(
- Integer fromVersion,
- Integer toVersion)
+ BuildInformation fromVersion,
+ BuildInformation toVersion)
throws ApplicationException {
Long id;
try {
@@ -1281,8 +1281,8 @@
private void writeHistoricalRecord(
Long id,
- Integer from,
- Integer to,
+ BuildInformation from,
+ BuildInformation to,
HistoricalRecord.Status status,
String note)
throws ApplicationException {
@@ -1457,8 +1457,8 @@
private void initialize() throws ApplicationException {
try {
- Integer fromVersion = getCurrentVersion();
- Integer toVersion = getStagedVersion();
+ BuildInformation fromVersion = getCurrentBuildInformation();
+ BuildInformation toVersion = getStagedBuildInformation();
this.historicalOperationId =
writeInitialHistoricalRecord(fromVersion, toVersion);
@@ -1649,10 +1649,10 @@
return new File(getUpgradeBackupDirectory(), "schema.custom.diff");
}
- private Integer getCurrentVersion() {
+ private BuildInformation getCurrentBuildInformation() {
if (this.currentVersion == null) {
try {
- currentVersion = getInstallation().getSvnRev();
+ currentVersion = getInstallation().getBuildInformation();
} catch (ApplicationException e) {
LOG.log(Level.INFO, "error trying to determine current version", e);
}
@@ -1660,10 +1660,10 @@
return currentVersion;
}
- private Integer getStagedVersion() {
+ private BuildInformation getStagedBuildInformation() {
if (stagedVersion == null) {
try {
- stagedVersion = getStagedInstallation().getSvnRev();
+ stagedVersion = getStagedInstallation().getBuildInformation();
} catch (Exception e) {
LOG.log(Level.INFO, "error", e);
}
--
Gitblit v1.10.0