Admin/PIDE/convert
author blanchet
Mon May 19 23:43:53 2014 +0200 (2014-05-19)
changeset 57008 10f68b83b474
parent 53498 05313b45a5ae
permissions -rwxr-xr-x
use E 1.8's auto scheduler option
wenzelm@53498
     1
#!/usr/bin/env bash
wenzelm@46245
     2
wenzelm@46245
     3
THIS="$(cd "$(dirname "$0")"; pwd)"
wenzelm@46245
     4
SUPER="$(cd "$THIS/.."; pwd)"
wenzelm@46245
     5
wenzelm@46245
     6
ISABELLE_REPOS="$(cd "$THIS/../.."; pwd)"
wenzelm@46245
     7
wenzelm@46245
     8
wenzelm@46245
     9
## main
wenzelm@46245
    10
wenzelm@46245
    11
FILEMAP="/tmp/filemap$$"
wenzelm@46245
    12
wenzelm@46245
    13
echo "include COPYRIGHT" > "$FILEMAP"
wenzelm@46245
    14
(
wenzelm@46245
    15
  cd "$ISABELLE_REPOS"
wenzelm@46245
    16
  for FILE in $(find src/Pure -name "*.scala")
wenzelm@46245
    17
  do
wenzelm@46245
    18
    if grep "Module:.*PIDE" "$FILE" >/dev/null; then
wenzelm@46245
    19
      if [ "$("${HG:-hg}" status -u -n --color=never "$FILE")" = "" ]; then
wenzelm@46245
    20
        echo "include $FILE" >> "$FILEMAP"
wenzelm@46245
    21
        echo "rename $FILE src/$(basename "$FILE")" >> "$FILEMAP"
wenzelm@46245
    22
      fi
wenzelm@46245
    23
    fi
wenzelm@46245
    24
  done
wenzelm@46245
    25
)
wenzelm@46245
    26
wenzelm@46245
    27
cat "$FILEMAP"
wenzelm@46245
    28
wenzelm@46245
    29
"${HG:-hg}" convert --filemap "$FILEMAP" "$ISABELLE_REPOS" PIDE-repos
wenzelm@46245
    30
wenzelm@46245
    31
rm -f "$FILEMAP"