]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/upgrade.py
Automatically perform logging during --continue.
[wizard.git] / wizard / command / upgrade.py
index 94af4f674d876d4e5818729483d2d53d5b3af536..18e7f9efe837d3d7990015fc7c2e8714bd858cc9 100644 (file)
@@ -28,6 +28,11 @@ def main(argv, baton):
         user_commit, next_commit = open(".git/WIZARD_PARENTS", "r").read().split()
         repo = open(".git/WIZARD_REPO", "r").read()
         version = open(".git/WIZARD_UPGRADE_VERSION", "r").read()
+        if not options.log_file and os.path.exists(".git/WIZARD_LOG_FILE"):
+            options.log_file = open(".git/WIZARD_LOG_FILE", "r").read()
+            # reload logging
+            command.addFileLogger(options.log_file, options.debug)
+        logging.info("Continuing upgrade...")
         util.chdir(sh.eval("git", "config", "remote.origin.url"))
         d = deploy.Deployment(".")
         try:
@@ -74,6 +79,7 @@ def main(argv, baton):
             open(".git/WIZARD_REPO", "w").write(repo)
             open(".git/WIZARD_UPGRADE_VERSION", "w").write(version)
             open(".git/WIZARD_PARENTS", "w").write("%s\n%s" % (user_commit, next_commit))
+            if options.log_file: open(".git/WIZARD_LOG_FILE", "w").write(options.log_file)
             perform_merge(sh, repo, d, version, use_shm)
     # variables: version, user_commit, next_commit, temp_wc_dir
     with util.ChangeDirectory(temp_wc_dir):