]> scripts.mit.edu Git - wizard.git/commitdiff
Suppress ^M characters from Git progress bars.
authorEdward Z. Yang <ezyang@mit.edu>
Fri, 9 Oct 2009 20:05:47 +0000 (16:05 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Fri, 9 Oct 2009 20:05:47 +0000 (16:05 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
TODO
wizard/app/mediawiki.py
wizard/command/install.py
wizard/command/restore.py
wizard/command/upgrade.py

diff --git a/TODO b/TODO
index d5d4a74aa4df9ff5305fbdab9983cb8a87ab7734..93444a86edfd18d084b1dc650f6a971db74700bf 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,13 +2,6 @@ The Git Autoinstaller
 
 TODO NOW:
 
-- Bugs
-    - Exception parsing doesn't work when HTML pages or other complex
-      output is returned, which results in hilarious mass error messages.
-      Check logs for 0324 for a relevant example.
-    - git pull, when it fails, has a lot of ^M characters; these should
-      be removed
-
 - Make it faster
     - Wipe temp directories if the upgrade succeeds
     - Put temp directories on tmpfs before merging, then move to disk
index d21ee156ed459ed8ba44d0ce635f3bc480ddb3a6..3fdec143f66fce2a0da23cbb42f939ad021e3cd6 100644 (file)
@@ -89,7 +89,7 @@ class Application(deploy.Application):
     def upgrade(self, d, version, options):
         sh = shell.Shell()
         if not os.path.isfile("AdminSettings.php"):
-            sh.call("git", "checkout", "mediawiki-" + str(version), "--", "AdminSettings.php")
+            sh.call("git", "checkout", "-q", "mediawiki-" + str(version), "--", "AdminSettings.php")
         try:
             result = sh.eval("php", "maintenance/update.php", "--quick", log=True)
         except shell.CallError as e:
index e736fc967a4763870ef548ba859f929b8a6fbffa..dee34529de242cc83fcc2b12743240a33c6e1f32 100644 (file)
@@ -17,10 +17,10 @@ def main(argv, baton):
     appname, _, version = app.partition('-')
     application = deploy.applications()[appname]
     sh = shell.Shell()
-    sh.call("git", "clone", "--shared", application.repository(options.srv_path), dir)
+    sh.call("git", "clone", "-q", "--shared", application.repository(options.srv_path), dir)
     with util.ChangeDirectory(dir):
         if version:
-            sh.call("git", "reset", "--hard", app)
+            sh.call("git", "reset", "-q", "--hard", app)
         # this command's stdin should be hooked up to ours
         try:
             configure_args = args[2:] + command.makeBaseArgs(options)
index c5d73c98b2844ff33d72c55585849b54ab10e2dd..35423c646f64b0157f870d43245b9c391969daee 100644 (file)
@@ -44,7 +44,7 @@ def main(argv, baton):
         sh.call("git", "rev-parse", tag)
     except shell.CallError:
         raise Exception("Tag %s doesn't exist in repository" % tag)
-    sh.call("git", "reset", "--hard", tag)
+    sh.call("git", "reset", "-q", "--hard", tag)
     d.restore(backup, options)
 
 def parse_args(argv, baton):
index ed8c8ce645632a8b9e4ae7efee5dc5489d3df826..4efbda83ae3f18f87dd366e0a471cfcfab4d90f6 100644 (file)
@@ -52,7 +52,7 @@ def main(argv, baton):
         temp_wc_dir = perform_tmp_clone(sh)
         with util.ChangeDirectory(temp_wc_dir):
             sh.call("git", "remote", "add", "scripts", repo)
-            sh.call("git", "fetch", "scripts")
+            sh.call("git", "fetch", "-q", "scripts")
             user_commit, next_commit = calculate_parents(sh, version)
             # save variables so that --continue will work
             # yeah yeah no trailing newline whatever
@@ -74,10 +74,10 @@ def main(argv, baton):
         # a master branch may not necessarily exist if the user
         # was manually installed to an earlier version
         try:
-            sh.call("git", "checkout", "-b", "master", "--")
+            sh.call("git", "checkout", "-q", "-b", "master", "--")
         except shell.CallError:
-            sh.call("git", "checkout", "master", "--")
-        sh.call("git", "reset", "--hard", final_commit)
+            sh.call("git", "checkout", "-q", "master", "--")
+        sh.call("git", "reset", "-q", "--hard", final_commit)
         d.verifyVersion()
     # Till now, all of our operations were in a tmp sandbox.
     if options.dry_run:
@@ -89,7 +89,7 @@ def main(argv, baton):
     with util.IgnoreKeyboardInterrupts():
         with util.LockDirectory(".scripts-upgrade-lock"):
             # git merge (which performs a fast forward)
-            sh.call("git", "pull", temp_wc_dir, "master")
+            sh.call("git", "pull", "-q", temp_wc_dir, "master")
             version_obj = distutils.version.LooseVersion(version.partition('-')[2])
             try:
                 # run update script
@@ -150,7 +150,7 @@ def perform_tmp_clone(sh):
     temp_dir = tempfile.mkdtemp(prefix="wizard")
     temp_wc_dir = os.path.join(temp_dir, "repo")
     logging.info("Using temporary directory: " + temp_wc_dir)
-    sh.call("git", "clone", "--shared", ".", temp_wc_dir)
+    sh.call("git", "clone", "-q", "--shared", ".", temp_wc_dir)
     return temp_wc_dir
 
 def perform_merge(sh, repo, d, version):
@@ -159,7 +159,7 @@ def perform_merge(sh, repo, d, version):
     # crazy merge algorithm:
     def make_virtual_commit(tag, parents = []):
         """WARNING: Changes state of Git repository"""
-        sh.call("git", "checkout", tag, "--")
+        sh.call("git", "checkout", "-q", tag, "--")
         d.parametrize(".")
         for file in d.application.parametrized_files:
             try: