]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/merge.py
Make newline conversions less chatty.
[wizard.git] / wizard / merge.py
index d33c578fe7a165d9a39123bd40ab565920f86739..dea36db700a504cf6cf29fb70cd52ee0c8c26ec9 100644 (file)
@@ -150,7 +150,7 @@ def merge(common_id, theirs_id,
                     # 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)
+                    logging.debug("Canonical version (theirs) of %s had no newline style, using \\n", file)
                 nl = "\n"
             theirs_newline_cache[file] = nl
         return theirs_newline_cache[file]
@@ -163,9 +163,12 @@ def merge(common_id, theirs_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)
-            shell.eval("git", "add", file)
+            if ours_nl == None:
+                logging.debug("File had no newlines, ignoring newline style")
+            else:
+                logging.info("Converting our file (3) from %s to %s newlines", repr(ours_nl), repr(theirs_nl))
+                convert_newline(file, theirs_nl)
+                shell.eval("git", "add", file)
     prepare_config() # for Wizard, this usually genericizes config files
     ours_tree = shell.eval("git", "write-tree")
     logging.info("Merge wrote virtual tree for ours: %s", ours_tree)