]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/migrate.py
Add --force-version to wizard migrate.
[wizard.git] / wizard / command / migrate.py
index 937dc52d2ba38183a96fc47ce02676c0b37c84bc..b159427dbed5b2972f378a1867cd1205a94b6d38 100644 (file)
@@ -40,7 +40,11 @@ def main(argv, baton):
 
     deployment.verifyTag(options.srv_path)
 
-    version = deployment.app_version
+    if options.force_version:
+        version = deployment.application.makeVersion(options.force_version)
+    else:
+        deployment.verifyVersion()
+        version = deployment.app_version
     repo    = version.application.repository(options.srv_path)
     tag     = version.scripts_tag
 
@@ -79,6 +83,9 @@ NOT run this command as root."""
     parser.add_option("--force", "-f", dest="force", action="store_true",
             default=False, help="If .git or .scripts directory already exists,"
             "delete them and migrate")
+    parser.add_option("--force-version", dest="force_version",
+            default=None, help="If .scripts-version tells lies, explicitly specify"
+            "a version to migrate to.")
     options, args = parser.parse_all(argv)
     if len(args) > 1:
         parser.error("too many arguments")