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
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:
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)