aboutsummaryrefslogtreecommitdiffstats
path: root/.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-08-31 12:32:05 -0400
committerW. Trevor King <wking@drexel.edu>2009-08-31 12:32:05 -0400
commit830522c293a479636d7bfc0fff125ec57f06e9a3 (patch)
treeff106861cf78b4b41d3206b901cbbbfbd9ef9adf /.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9
parentbaa45573a54bf8f7fdcd7fc53d13f9f160954da7 (diff)
downloadbugseverywhere-830522c293a479636d7bfc0fff125ec57f06e9a3.tar.gz
Added libbe/upgrade.py to handle upgrading on-disk bugdirs.
Diffstat (limited to '.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9')
-rw-r--r--.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9/body30
-rw-r--r--.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9/values11
2 files changed, 41 insertions, 0 deletions
diff --git a/.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9/body b/.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9/body
new file mode 100644
index 0000000..34d37e5
--- /dev/null
+++ b/.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9/body
@@ -0,0 +1,30 @@
+Added libbe/upgrade.py to handle upgrading on-disk bugdirs.
+
+When upgrade.BUGDIR_DISK_VERSION changes, a series of Updater
+classes handle the upgrade. For example, if
+ BUGDIR_DISK_VERSIONS = ["v1", "v2", "v3"]
+and the on-disk version is "v1", you should have defined classes
+ class Upgrade_1_to_2 (Upgrader):
+ initial_version = "v1"
+ final_version = "v2"
+ def _upgrade():
+ ....
+ class Upgrade_2_to_3 (Upgrader):
+ initial_version = "v2"
+ final_version = "v3"
+ def _upgrade():
+ ....
+and added them to upgraders:
+ upgraders = [Upgrade_1_to_2, Upgrade_2_to_3]
+If the on-disk version is v2, then only Upgrade_2_to_3.upgrade() is
+run. If the on-disk version is v1, then Upgrade_1_to_2.upgrade() is
+run, followed by Upgrade_2_to_3.upgrade().
+
+You can optionally define shortcut upgrades (e.g. Upgrade_1_to_3) for
+efficiency or to avoid data loss.
+
+This upgrade occurs during BugDir.load(), which is called by
+BugDir.__init__(from_disk=True), before any processing of the on-disk
+data except for the access of .be/version to determine if an upgrade
+was necessary.
+
diff --git a/.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9/values b/.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9/values
new file mode 100644
index 0000000..b296bff
--- /dev/null
+++ b/.be/bugs/51930348-9ccc-4165-af41-6c7450de050e/comments/d304f93b-faf2-477e-9ff8-c77e301fd9f9/values
@@ -0,0 +1,11 @@
+Author: W. Trevor King <wking@drexel.edu>
+
+
+Content-type: text/plain
+
+
+Date: Mon, 31 Aug 2009 16:29:50 +0000
+
+
+In-reply-to: f1479ecf-4154-4cd4-bbd6-0ed6275b9f98
+