]> scripts.mit.edu Git - wizard.git/commitdiff
Workaround some bugs discovered while running.
authorEdward Z. Yang <ezyang@mit.edu>
Mon, 18 Jan 2010 09:30:00 +0000 (04:30 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Mon, 18 Jan 2010 09:30:00 +0000 (04:30 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
wizard/command/mass_upgrade.py
wizard/merge.py

index 649ac0f55755b698865cd97c5df58d73e2d57eee..67be3c60ce3a77ded0c429dedd2cdb69a1c78b71 100644 (file)
@@ -27,6 +27,7 @@ def main(argv, baton):
     except OSError as e:
         if e.errno != errno.EEXIST:
             raise
+    os.chmod(rr_cache, 0o777)
     # loop stuff
     errors = {}
     i = 0
index 94cc13c1d1bb8a0e8a9c33da027726d61ca5b5f7..d4ea0942031ccede45f82460ff480c2ad8dd3a43 100644 (file)
@@ -146,16 +146,22 @@ def merge(common_id, theirs_id,
         if file not in theirs_newline_cache:
             nl = git_newline_style(theirs_id, file)
             if not isinstance(nl, str):
-                # A case of incompetent upstream, unfortunately
-                logging.warning("Canonical version (theirs) of %s has mixed newline style, forced to \\n", file)
+                if nl is not None:
+                    # A case of incompetent upstream, unfortunately
+                    logging.warning("Canonical version (theirs) of %s has mixed newline style, forced to \\n", file)
+                else:
+                    logging.info("Canonical version (theirs) of %s had no newline style, using \\n", file)
                 nl = "\n"
             theirs_newline_cache[file] = nl
         return theirs_newline_cache[file]
     theirs_tree = shell.eval("git", "rev-parse", "%s^{tree}" % theirs_id)
     # operations on the ours tree
     for file in git_diff_text(ours_id, theirs_id):
-        theirs_nl = get_theirs_newline(file)
-        ours_nl = get_newline(file) # current checkout is ours_id
+        try:
+            theirs_nl = get_theirs_newline(file)
+            ours_nl = get_newline(file) # current checkout is ours_id
+        except (IOError, shell.CallError): # hack
+            continue
         if theirs_nl != ours_nl:
             logging.info("Converting our file (3) from %s to %s newlines", repr(ours_nl), repr(theirs_nl))
             convert_newline(file, theirs_nl)
@@ -166,8 +172,11 @@ def merge(common_id, theirs_id,
     # operations on the common tree
     shell.call("git", "reset", "--hard", common_id)
     for file in git_diff_text(common_id, theirs_id):
-        theirs_nl = get_theirs_newline(file)
-        common_nl = get_newline(file) # current checkout is common_id
+        try:
+            theirs_nl = get_theirs_newline(file)
+            common_nl = get_newline(file) # current checkout is common_id
+        except (IOError, shell.CallError): # hack
+            continue
         if theirs_nl != common_nl:
             logging.info("Converting common file (1) from %s to %s newlines", repr(common_nl), repr(theirs_nl))
             convert_newline(file, theirs_nl)