Skip to content

Instantly share code, notes, and snippets.

Created May 17, 2012 00:59

Revisions

  1. @invalid-email-address Anonymous created this gist May 17, 2012.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/bash
    THIS_FOLDER=`dirname $0`

    node=$1

    # What files have changed
    files=`hg log --template="{files}" -r $node`

    # Check each
    for file in $files; do
    type=`hg cat -r tip $file | file -b -`
    if [[ "$type" =~ "text, with CRLF line terminators" ]]; then
    echo "INFO: $file is $type"
    echo "ERROR: $file is not ascii text with unix line ends"
    exit 1;
    fi
    done