]> scripts.mit.edu Git - wizard.git/commitdiff
Add UnknownVersionError for versions we don't know about.
authorEdward Z. Yang <ezyang@mit.edu>
Tue, 1 Jun 2010 05:58:18 +0000 (22:58 -0700)
committerEdward Z. Yang <ezyang@mit.edu>
Tue, 1 Jun 2010 05:58:18 +0000 (22:58 -0700)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
TODO
wizard/command/upgrade.py

diff --git a/TODO b/TODO
index 8a204e8d9bbc5333762c2ff461bccf25c347a3eb..fc2a0deb815e3bc69bc43a6ac373aefd87fe38c5 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,6 +2,8 @@ The Git Autoinstaller
 
 TODO NOW:
 
+- MediaWiki 1.9.3 and 1.6.7
+
 - If no newlines at all, DON'T CARE (don't rewrite the file again!)
 - Plugin-ify!
 - Check for improper use of os.exists() when os.lexists() was meant
index c4fb8c66979356e69592ebac8898b4807d475d66..ecc0847847baa7d24b504db8fc2fa8ffa216a5c6 100644 (file)
@@ -173,7 +173,13 @@ class Upgrade(object):
             except deploy.VersionMismatchError as e:
                 # XXX: kind of hacky, mainly it does change the Git working copy
                 # state (although /very/ non-destructively)
-                shell.call("git", "merge", "--strategy=ours", self.prod.application.makeVersion(str(e.real_version)).scripts_tag)
+                try:
+                    shell.call("git", "merge", "--strategy=ours", self.prod.application.makeVersion(str(e.real_version)).scripts_tag)
+                except shell.CallError as e2:
+                    if "does not point to a commit" in e2.stderr:
+                        raise UnknownVersionError(e.real_version)
+                    else:
+                        raise
                 continue
             break
         else:
@@ -534,5 +540,19 @@ class VersionRematchFailed(Error):
 
 ERROR: Your Git version information was not consistent with your
 files on the system, and we were unable to create a fake merge
-to make the two consistent.  Please contact scripts@mit.edu.
+to make the two consistent.  Please contact scripts@mit.edu
+with this error message.
 """
+
+class UnknownVersionError(Error):
+    #: Version that we didn't have
+    version = None
+    def __init__(self, version):
+        self.version = version
+    def __str__(self):
+        return """
+
+ERROR: The version you are attempting to upgrade from (%s)
+is unknown to the repository Wizard is using.  Please contact
+scripts@mit.edu with this error message.
+""" % str(self.version)