+ if options.force_version:
+ version = deployment.application.makeVersion(options.force_version)
+ else:
+ try:
+ deployment.verifyVersion()
+ version = deployment.app_version
+ except deploy.VersionMismatchError as e:
+ # well, we'll use that then
+ version = deployment.application.makeVersion(str(e.real_version))
+ repo = version.application.repository(options.srv_path)
+ tag = version.scripts_tag
+ try:
+ sh.call("git", "--git-dir=%s" % repo, "rev-parse", tag)
+ except shell.CallError:
+ raise UnsupportedVersion(version.version)
+
+ with util.LockDirectory(".scripts-migrate-lock"):
+ try:
+ if options.force:
+ perform_force(options)
+ make_repository(sh, options, repo, tag)
+ check_variables(deployment, options)
+ except KeyboardInterrupt:
+ # revert it; barring zany race conditions this is safe
+ if os.path.exists(".scripts"):
+ shutil.rmtree(".scripts")
+ if os.path.exists(".git"):
+ shutil.rmtree(".git")
+
+def parse_args(argv, baton):