Admin/PIDE/convert
changeset 64385 d072d327b9b2
parent 64380 4b22e1268779
child 64386 e936967c2a06
equal deleted inserted replaced
64380:4b22e1268779 64385:d072d327b9b2
     1 #!/usr/bin/env bash
       
     2 
       
     3 THIS="$(cd "$(dirname "$0")"; pwd)"
       
     4 SUPER="$(cd "$THIS/.."; pwd)"
       
     5 
       
     6 ISABELLE_REPOS="$(cd "$THIS/../.."; pwd)"
       
     7 
       
     8 
       
     9 ## main
       
    10 
       
    11 FILEMAP="/tmp/filemap$$"
       
    12 
       
    13 echo "include COPYRIGHT" > "$FILEMAP"
       
    14 (
       
    15   cd "$ISABELLE_REPOS"
       
    16   for FILE in $(find src/Pure -name "*.scala")
       
    17   do
       
    18     if grep "Module:.*PIDE" "$FILE" >/dev/null; then
       
    19       if [ "$("${HG:-hg}" status -u -n --color=never "$FILE")" = "" ]; then
       
    20         echo "include $FILE" >> "$FILEMAP"
       
    21         echo "rename $FILE src/$(basename "$FILE")" >> "$FILEMAP"
       
    22       fi
       
    23     fi
       
    24   done
       
    25 )
       
    26 
       
    27 cat "$FILEMAP"
       
    28 
       
    29 "${HG:-hg}" convert --filemap "$FILEMAP" "$ISABELLE_REPOS" PIDE-repos
       
    30 
       
    31 rm -f "$FILEMAP"