]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/util.py
Add CRLF/LF/CR merge resolution algoritm of AWESOME.
[wizard.git] / wizard / util.py
index b0ab342b428f8c9e6c4e38903665ec21d4649984..174c13f161ed7524c4299fa7c5c0a59cb32eb240 100644 (file)
@@ -324,6 +324,14 @@ def fetch(host, path, subpath, post=None):
     h.close()
     return data
 
+def mixed_newlines(filename):
+    """Returns ``True`` if ``filename`` has mixed newlines."""
+    f = open(filename, "U") # requires universal newline support
+    f.read()
+    ret = isinstance(f.newlines, tuple)
+    f.close() # just to be safe
+    return ret
+
 class NoOperatorInfo(wizard.Error):
     """No information could be found about the operator from Kerberos."""
     pass